From 13b9dcd466316b69d9ef1dd59d5c4130060b0ee1 Mon Sep 17 00:00:00 2001 From: David Zhang Date: Thu, 15 Jun 2017 04:37:21 +0800 Subject: [PATCH] Document difference between cgi_escape and uri_escape #5970 (#6081) Merge pull request 6081 --- docs/_docs/templates.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/_docs/templates.md b/docs/_docs/templates.md index c4eba3c8..40a3e032 100644 --- a/docs/_docs/templates.md +++ b/docs/_docs/templates.md @@ -178,15 +178,15 @@ common tasks easier.

CGI Escape

CGI escape a string for use in a URL. Replaces any special characters - with appropriate %XX replacements. + with appropriate %XX replacements. CGI escape normally replaces a space with a plus + sign.

- {% raw %}{{ "foo,bar;baz?" | cgi_escape }}{% endraw %} + {% raw %}{{ "foo, bar; baz?" | cgi_escape }}{% endraw %}

- foo%2Cbar%3Bbaz%3F + foo%2C+bar%3B+baz%3F

@@ -194,15 +194,15 @@ common tasks easier.

URI Escape

- Percent encodes any special characters in a URI. + Percent encodes any special characters in a URI. URI escape normally replaces a space with %20. Reserved characters will not be escaped.

- {% raw %}{{ "http://foo.com/?query=foo, bar \baz?" | uri_escape }}{% endraw %} + {% raw %}{{ "http://foo.com/?q=foo, \bar?" | uri_escape }}{% endraw %}

- http://foo.com/?query=foo,%20bar%20%5Cbaz? + http://foo.com/?q=foo,%20%5Cbar?