New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
% characters are stripped out of URLs #1292
Comments
It turns out that this issue is not limited to the pagination module. The issues is with the https://github.com/spf13/hugo/blob/master/helpers/path.go#L97 |
This precedes my time with Hugo. @spf13 might now why % are stripped? |
I just filtered out any character that may be an issue as part of a filename in any os, even some that were ok in urls. It seems innocuous enough to include this back in. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The
section
variable passed into the pagination module is already URL encoded,https://github.com/spf13/hugo/blob/master/hugolib/pagination.go#L370
but the pagination URLs are encoded again using function
URLizeAndPrep()
inhttps://github.com/spf13/hugo/blob/master/hugolib/pagination.go#L515
This yields incorrect URLs for pagination templates.
For example, a section name contains accent characters (añame) encoded as
a%C3%B1ame
, when processed by functionURLizeAndPrep()
, will becomeac3b1ame
, the%
characters are stripped out.And there may be other cases for non-English section names which are not handled correctly.
Removing the call to the
URLizeAndPrep()
function temporarily fix this issue for me, but the URL handling should be reviewed and should be consistent with URLs in Nodes and Pages.The text was updated successfully, but these errors were encountered: