Skip to content

Conformance Examples 0.1.0 — Transforms: transform-url_param_escape

url_param_escape-ampersand-encoded

Unlike url_escape, & becomes %26.

Template

{{{ q | url_param_escape }}}

Context

{
    "q": "a&b"
}

Output

a%26b

url_param_escape-equals-encoded

Unlike url_escape, = becomes %3D.

Template

{{{ q | url_param_escape }}}

Context

{
    "q": "k=v"
}

Output

k%3Dv

url_param_escape-space-percent-encoded

Space becomes %20 (same as url_escape).

Template

{{{ q | url_param_escape }}}

Context

{
    "q": "a b"
}

Output

a%20b

url_param_escape-other-reserved-preserved

Other reserved characters (excluding & and =) are still preserved.

Template

{{{ q | url_param_escape }}}

Context

{
    "q": ":/?#[]@!$'()*+,;"
}

Output

:/?#[]@!$'()*+,;

url_param_escape-utf8-multibyte

Non-ASCII is percent-encoded as UTF-8.

Template

{{{ q | url_param_escape }}}

Context

{
    "q": "café"
}

Output

caf%C3%A9

url_param_escape-empty

Empty input passes through.

Template

{{{ q | url_param_escape }}}

Context

{
    "q": ""
}

Output


Source fixture: transforms/transform-url_param_escape.json