Add '+' as one of the valid characters in urls specified in the front matter Fixes #1290 - hugo - [fork] hugo port for 9front
(HTM) git clone git@git.drkhsh.at/hugo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit c42982f76b397a5875114b59391712048e168348
(DIR) parent 02effd9dc46201df250564cdbbee1ca2291eb8b4
(HTM) Author: Aditya Bhargava <bluemangroupie@gmail.com>
Date: Sat, 12 Mar 2016 15:48:21 -0800
Add '+' as one of the valid characters in urls specified in the front matter
Fixes #1290
Diffstat:
M helpers/path.go | 2 +-
M helpers/path_test.go | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/helpers/path.go b/helpers/path.go
@@ -95,7 +95,7 @@ func UnicodeSanitize(s string) string {
target := make([]rune, 0, len(source))
for _, r := range source {
- if unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r) || r == '%' || r == '.' || r == '/' || r == '\\' || r == '_' || r == '-' || r == '#' {
+ if unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r) || r == '%' || r == '.' || r == '/' || r == '\\' || r == '_' || r == '-' || r == '#' || r == '+' {
target = append(target, r)
}
}
(DIR) diff --git a/helpers/path_test.go b/helpers/path_test.go
@@ -48,6 +48,7 @@ func TestMakePath(t *testing.T) {
// Issue #1488
{"संस्कृत", "संस्कृत", false},
{"a%C3%B1ame", "a%C3%B1ame", false}, // Issue #1292
+ {"this+is+a+test", "this+is+a+test", false}, // Issue #1290
}
for _, test := range tests {