shithub: hugo

Download patch

ref: 7862de91de5d8d8d6e00804f8352bd665d86d202
parent: 83c6806576a27942d49ff0cf81712b14bfda43e0
author: Bjørn Erik Pedersen <[email protected]>
date: Mon Dec 12 19:15:21 EST 2016

tpl: Add a querify test case that is actually and URL

See #2780

--- a/tpl/template_funcs_test.go
+++ b/tpl/template_funcs_test.go
@@ -129,7 +129,8 @@
 mul: {{mul 2 3}}
 plainify: {{ plainify  "Hello <strong>world</strong>, gophers!" }}
 pluralize: {{ "cat" | pluralize }}
-querify: {{ (querify "foo" 1 "bar" 2 "baz" "with spaces" "qux" "this&that=those") | safeHTML }}
+querify 1: {{ (querify "foo" 1 "bar" 2 "baz" "with spaces" "qux" "this&that=those") | safeHTML }}
+querify 2: <a href="https://www.google.com?{{ (querify "q" "test" "page" 3) | safeURL }}">Search</a>
 readDir: {{ range (readDir ".") }}{{ .Name }}{{ end }}
 readFile: {{ readFile "README.txt" }}
 relLangURL: {{ "index.html" | relLangURL }}
@@ -199,7 +200,8 @@
 mul: 6
 plainify: Hello world, gophers!
 pluralize: cats
-querify: bar=2&baz=with+spaces&foo=1&qux=this%26that%3Dthose
+querify 1: bar=2&baz=with+spaces&foo=1&qux=this%26that%3Dthose
+querify 2: <a href="https://www.google.com?page=3&amp;q=test">Search</a>
 readDir: README.txt
 readFile: Hugo Rocks!
 relLangURL: /hugo/en/index.html