]> git.maquefel.me Git - brevno-suite/hugo/commit
resources/page: Escape hash sign in permalinks
authorSoren L. Hansen <sorenisanerd@gmail.com>
Thu, 4 Apr 2024 20:31:20 +0000 (13:31 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 5 Apr 2024 13:57:02 +0000 (15:57 +0200)
commit4500b0e423a2c58e6e54526d0d02d2924cc774b6
tree21ea70f023d7614c67d84f2dda8a841031b5db02
parent060cce0a910ffd9dc4e92efbe758fc5f187c3145
resources/page: Escape hash sign in permalinks

When creating a link to a file with a `#` in the filename, the link gets
truncated. This happens because the filename is eventaully passed to
`url.Parse` which (correctly!) interprets the `#` as fragment separator.

This commit escapes the `#` in the filename before creating the link.

Fixes #4926
Fixes #8232
Fixes #12342

Co-authored-by: Joe Mooring <joe.mooring@veriphor.com>
resources/page/page_paths.go
resources/page/path_integration_test.go [new file with mode: 0644]