Switch to html5-compatible fragment encoding for wikipedia URLs
Fixes #3269 In the HTML4 days, fragments weren't allowed to have `%` signs, so mediawiki generated fragments with `%` replaced with a `.` In HTML5, fragments can have % encoded characters, and so in 2017 wikipedia switched over to this for their automatically generated fragments, while keeping the "dot" versions available as a fallback. However, we have been automatically converting all fragments, including manually specified anchors that do not have "dot"-encoded versions available. So we can now simplify everything by just using the HTML5 percent-encoded fragments.
This commit is contained in:
parent
61e963ecdb
commit
dd9eca9346
2 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ module BrowseTagsHelper
|
|||
# Must break it up to correctly build the url
|
||||
value = Regexp.last_match(1)
|
||||
section = "##{Regexp.last_match(2)}"
|
||||
encoded_section = "##{CGI.escape(Regexp.last_match(2).gsub(/ +/, '_')).tr('%', '.')}"
|
||||
encoded_section = "##{CGI.escape(Regexp.last_match(2).gsub(/ +/, '_'))}"
|
||||
else
|
||||
section = ""
|
||||
encoded_section = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue