diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-10-03 10:14:45 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-10-03 15:55:25 +0200 |
commit | e421696d02bfb8764ae57238e211ce0e85e9782e (patch) | |
tree | c50ea4931bc05be44192cd3178c62f24ec2c72d4 /helpers/path_test.go | |
parent | 4b4af2c52e658d516dd4bfaf59fef4f054dabec3 (diff) | |
download | hugo-e421696d02bfb8764ae57238e211ce0e85e9782e.tar.gz hugo-e421696d02bfb8764ae57238e211ce0e85e9782e.zip |
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
Diffstat (limited to 'helpers/path_test.go')
-rw-r--r-- | helpers/path_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helpers/path_test.go b/helpers/path_test.go index a97e3d507..a1110b094 100644 --- a/helpers/path_test.go +++ b/helpers/path_test.go @@ -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 { |