commit 6c900380dc3e7a3b7a7e26ece95c690cf6baea5a
parent f2ff77f3ac3d2f347cc81f7aabf15d5b55cf2e0c
Author: digitalcraftsman <digitalcraftsman@protonmail.com>
Date: Fri, 8 Apr 2016 21:36:35 +0200
tpl: Add replaceRE to the "smoke tests"
Fixes #2063
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/tpl/template_funcs_test.go b/tpl/template_funcs_test.go
@@ -107,6 +107,7 @@ readFile: {{ readFile "README.txt" }}
relURL 1: {{ "http://gohugo.io/" | relURL }}
relURL 2: {{ "mystyle.css" | relURL }}
replace: {{ replace "Batman and Robin" "Robin" "Catwoman" }}
+replaceRE: {{ "http://gohugo.io/docs" | replaceRE "^https?://([^/]+).*" "$1" }}
safeCSS: {{ "Bat&Man" | safeCSS | safeCSS }}
safeHTML: {{ "Bat&Man" | safeHTML | safeHTML }}
safeHTML: {{ "Bat&Man" | safeHTML }}
@@ -157,6 +158,7 @@ readFile: Hugo Rocks!
relURL 1: http://gohugo.io/
relURL 2: /hugo/mystyle.css
replace: Batman and Catwoman
+replaceRE: gohugo.io
safeCSS: Bat&Man
safeHTML: Bat&Man
safeHTML: Bat&Man