mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
helpers: Consolidate MakeSegment vs MakePathSanitized
In short: * Avoid double tolower in MakeSegment * Use MakePathSanitized for taxonomies in pageToPermalinkTitle; this matches what MakeSegment does. * Move the "double hyphen and space" logic into UnicodeSanitize The last bullet may be slightly breaking for some that now does not get the "--" in some URLs, but we need to reduce the amount of URL logic. See #4926
This commit is contained in:
@@ -51,7 +51,8 @@ func TestMakeSegment(t *testing.T) {
|
||||
{"Your #1 Fan", "your-1-fan"},
|
||||
{"Red & Blue", "red-blue"},
|
||||
{"double//slash", "double-slash"},
|
||||
{"My // Taxonomy", "my-taxonomy"},
|
||||
{"triple///slash", "triple-slash"},
|
||||
{"-my/way-", "my-way"},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
Reference in New Issue
Block a user