mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
Add '+' as one of the valid characters in urls specified in the front matter
Fixes #1290
This commit is contained in:
committed by
Steve Francia
parent
02effd9dc4
commit
c42982f76b
@@ -95,7 +95,7 @@ func UnicodeSanitize(s string) string {
|
|||||||
target := make([]rune, 0, len(source))
|
target := make([]rune, 0, len(source))
|
||||||
|
|
||||||
for _, r := range 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)
|
target = append(target, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,6 +48,7 @@ func TestMakePath(t *testing.T) {
|
|||||||
// Issue #1488
|
// Issue #1488
|
||||||
{"संस्कृत", "संस्कृत", false},
|
{"संस्कृत", "संस्कृत", false},
|
||||||
{"a%C3%B1ame", "a%C3%B1ame", false}, // Issue #1292
|
{"a%C3%B1ame", "a%C3%B1ame", false}, // Issue #1292
|
||||||
|
{"this+is+a+test", "this+is+a+test", false}, // Issue #1290
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
Reference in New Issue
Block a user