mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-12 19:00:39 -07:00
Compare commits
3
Commits
747bdbdbee
...
39233ba9f2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39233ba9f2 | ||
|
|
8f57d9fed8 | ||
|
|
9af92f5d8c |
@@ -856,6 +856,15 @@
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sarathfrancis90",
|
||||
"name": "Sarath Francis",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/9289498?v=4",
|
||||
"profile": "https://github.com/sarathfrancis90",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
||||
@@ -243,6 +243,7 @@ Want to contribute? see [Contribution Guidelines][contribution]. Thanks goes to
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/spokodev"><img src="https://avatars.githubusercontent.com/u/239690017?v=4?s=100" width="100px;" alt="spokodev"/><br /><sub><b>spokodev</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=spokodev" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/YacovGold"><img src="https://avatars.githubusercontent.com/u/8984042?v=4?s=100" width="100px;" alt="YacovGold"/><br /><sub><b>YacovGold</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=YacovGold" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sarathfrancis90"><img src="https://avatars.githubusercontent.com/u/9289498?v=4?s=100" width="100px;" alt="Sarath Francis"/><br /><sub><b>Sarath Francis</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=sarathfrancis90" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
"build:contributors": "node bin/build-contributors.js",
|
||||
"build:apidoc": "shx rm -rf docs/source/api && typedoc --plugin typedoc-plugin-missing-exports ./src --gitRevision master --out docs/source/api",
|
||||
"build:changelog": "node bin/build-changelog.js",
|
||||
"build:docs-hexo": "cd docs && npm ci && npm run build && shx cp CNAME public/",
|
||||
"build:docs-hexo": "cd docs && npm ci && npm run build && shx cp CNAME .nojekyll public/",
|
||||
"serve:docs": "cd docs && npm run start",
|
||||
"dev:docs": "run-s prepare:docs serve:docs"
|
||||
},
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { stringify } from '../util/underscore'
|
||||
|
||||
export const url_decode = (x: string) => decodeURIComponent(stringify(x)).replace(/\+/g, ' ')
|
||||
export const url_decode = (x: string) => decodeURIComponent(stringify(x).replace(/\+/g, ' '))
|
||||
export const url_encode = (x: string) => encodeURIComponent(stringify(x)).replace(/%20/g, '+')
|
||||
export const cgi_escape = (x: string) => encodeURIComponent(stringify(x))
|
||||
.replace(/%20/g, '+')
|
||||
|
||||
@@ -7,6 +7,14 @@ describe('filters/url', () => {
|
||||
const html = liquid.parseAndRenderSync('{{ "%27Stop%21%27+said+Fred" | url_decode }}')
|
||||
expect(html).toEqual("'Stop!' said Fred")
|
||||
})
|
||||
it('should decode %2B to a literal plus', () => {
|
||||
const html = liquid.parseAndRenderSync('{{ "1%2B1" | url_decode }}')
|
||||
expect(html).toEqual('1+1')
|
||||
})
|
||||
it('should keep a literal plus when round-tripped through url_encode', () => {
|
||||
const html = liquid.parseAndRenderSync('{{ "a+b c" | url_encode | url_decode }}')
|
||||
expect(html).toEqual('a+b c')
|
||||
})
|
||||
})
|
||||
|
||||
describe('url_encode', () => {
|
||||
|
||||
Reference in New Issue
Block a user