tlienart/Franklin.jl

Tag pages don't urlencode their crosslinks

Seelengrab opened this issue · 0 comments

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.