Add '+' as one of the valid characters in urls specified in the front matter

Fixes #1290
This commit is contained in:
Aditya Bhargava 2016-03-12 15:48:21 -08:00 committed by Steve Francia
parent 02effd9dc4
commit c42982f76b
2 changed files with 2 additions and 1 deletions

View file

@ -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)
}
}

View file

@ -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 {