Skip to content
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

Tag pages don't urlencode their crosslinks #1063

Open
Seelengrab opened this issue Nov 9, 2023 · 0 comments
Open

Tag pages don't urlencode their crosslinks #1063

Seelengrab opened this issue Nov 9, 2023 · 0 comments

Comments

@Seelengrab
Copy link
Contributor

Seelengrab commented Nov 9, 2023

If you have a directory foo/what's new in X?/ with an article including tags and want to get to that article from those tags, the link will be broken because of the '. The href needs to be url encoded, e.g. with this function (I think it's correct, but not 100% sure):

urlencode(s::String) = replace(s,
    ' ' =>  "%20",
    '!' =>  "%21",
    '"' =>  "%22",
    '#' =>  "%23",
    '\$' => "%24",
    '%' =>  "%25",
    '&' =>  "%26",
    '\'' => "%27",
    '(' =>  "%28",
    ')' =>  "%29",
    '*' =>  "%2A",
    '+' =>  "%2B",
    ',' =>  "%2C",
    '-' =>  "%2D",
    '.' =>  "%2E",
    '/' =>  "%2F",
    ':' =>  "%3A",
    ';' =>  "%3B",
    '<' =>  "%3C",
    '=' =>  "%3D",
    '>' =>  "%3E",
    '?' =>  "%3F",
    '@' =>  "%40",
    '[' =>  "%5B",
    '\\' => "%5C",
    ']' =>  "%5D",
    '{' =>  "%7B",
    '|' =>  "%7C",
    '}' =>  "%7D"
)

happy to make a PR, if you can tell me where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant