shithub: hugo

Download patch

ref: c42982f76b397a5875114b59391712048e168348
parent: 02effd9dc46201df250564cdbbee1ca2291eb8b4
author: Aditya Bhargava <[email protected]>
date: Sat Mar 12 10:48:21 EST 2016

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

--- a/helpers/path.go
+++ b/helpers/path.go
@@ -95,7 +95,7 @@
 	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)
 		}
 	}
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -48,6 +48,7 @@
 		// 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 {