1
0
Fork 0
hugo/helpers
Bjørn Erik Pedersen 34033e349a
Strip hash sign (#) from file paths/URLs
The general way Hugo does this now is:

* Sanitize the file paths so the work as URLs
* When we create the final RelPermalink/Permalink, we use Go's `url.Parse` to escape it so it work for the browser.

So, leaving anything in the first step that does not work with the second step, just doesn't work.

It's a little bit odd that `url.Parse` silently truncates this URL without any error, but that's for another day.

I have another better test coverage for this.

Fixes #12342
Fixes #4926
See #8232
2024-04-05 11:37:18 +02:00
..
content.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
content_test.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
docshelper.go deps: Udpate to github.com/alecthomas/chroma/v2 2022-06-14 14:08:40 +02:00
emoji.go all: Remove unused code 2023-12-18 19:51:26 +01:00
emoji_test.go markdown: Pass emoji codes to yuin/goldmark-emoji 2023-10-24 12:04:13 +02:00
general.go Fix regression on handling of overlapping file mounts 2024-02-22 15:36:27 +01:00
general_test.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
path.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
path_test.go Strip hash sign (#) from file paths/URLs 2024-04-05 11:37:18 +02:00
pathspec.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
processing_stats.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00
testhelpers_test.go Replace the old log setup, with structured logging etc. 2023-06-18 13:03:04 +02:00
url.go Strip hash sign (#) from file paths/URLs 2024-04-05 11:37:18 +02:00
url_test.go all: Rework page store, add a dynacache, improve partial rebuilds, and some general spring cleaning 2024-01-27 16:28:14 +01:00