[openstreetmap/openstreetmap-website] Fully encode wikipedia tag values (PR #4887)
Andy Allan
notifications at github.com
Wed Jun 19 13:47:26 UTC 2024
Merged, thanks!
> Urls will get uglier, especially non-English ones.
But the URLs aren't shown (in their percent-encoded form) in most places to most users. For example, I use Firefox, and both when hovering over the link, and then in the url bar after clicking the link, the unencoded form is shown (i.e. no encoding, therefore no ugliness).
What I would prefer, is rather than `u s.tr(" ", "_")` is to avoid using the (mediawiki-specific) underscores, and just percent-encode everything. That would lead to simpler code too.
```diff
- url = "https://#{lang}.wikipedia.org/wiki/#{wiki_encode(title)}?uselang=#{I18n.locale}"
- url += "##{wiki_encode(section)}" if section
+ url = "https://#{lang}.wikipedia.org/wiki/#{url_encode(title)}?uselang=#{I18n.locale}"
+ url += "##{url_encode(section)}" if section
```
But in the grand scheme of things, this isn't important, and so I'm happy to merge as-is.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4887#issuecomment-2178765000
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4887/c2178765000 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240619/ac54a566/attachment.htm>
More information about the rails-dev
mailing list