Repository: gohugoio/hugo (language: go)

Issue:
Allow at sign in URL
With the https scheme, while the `@` symbol has special meaning before the host portion of the URL, it does not have special meaning in the path.

For example, Google Maps uses the `@` symbol prior to geo coordinates:
https://www.google.com/maps/place/Paris,+France/@48.8588336,2.2769957,...

Although probably limited in scope, this change would break existing link references in the wild.

Reference:
<https://discourse.gohugo.io/t/anyway-to-allow-urls-to-have-the-character/41980>




Discussion / hints:

Fix patch:
diff --git a/helpers/path.go b/helpers/path.go
index ad2ff765803..b3f69ff90c6 100644
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -102,7 +102,7 @@ func (p *PathSpec) UnicodeSanitize(s string) string {
 	)
 
 	for i, r := range source {
-		isAllowed := r == '.' || r == '/' || r == '\\' || r == '_' || r == '#' || r == '+' || r == '~' || r == '-'
+		isAllowed := r == '.' || r == '/' || r == '\\' || r == '_' || r == '#' || r == '+' || r == '~' || r == '-' || r == '@'
 		isAllowed = isAllowed || unicode.IsLetter(r) || unicode.IsDigit(r) || unicode.IsMark(r)
 		isAllowed = isAllowed || (r == '%' && i+2 < len(source) && ishex(source[i+1]) && ishex(source[i+2]))
 


Test patch:
diff --git a/helpers/path_test.go b/helpers/path_test.go
index 3d0617f54f5..b8739f37ad5 100644
--- a/helpers/path_test.go
+++ b/helpers/path_test.go
@@ -57,6 +57,7 @@ func TestMakePath(t *testing.T) {
 		{"this+is+a+test", "this+is+a+test", false}, // Issue #1290
 		{"~foo", "~foo", false},                     // Issue #2177
 		{"foo--bar", "foo--bar", true},              // Issue #7288
+		{"foo@bar", "foo@bar", true},                //	Issue #10548
 	}
 
 	for _, test := range tests {