[openstreetmap/openstreetmap-website] Stop arguments in path or query from being interpreted as hashes (PR #6613)

Pablo Brasero notifications at github.com
Wed Dec 17 17:07:00 UTC 2025


pablobm left a comment (openstreetmap/openstreetmap-website#6613)

I hoped the test would explain, but it didn't :sweat_smile: I went and had a look. I think I understand now:
- Changeset tag values go through tag2link.
- tag2link feeds from this list: https://github.com/JOSM/tag2link/blob/master/index.json
- Each separate tag in a `hashtags` key in a changeset gets applied this substitution rule:
```
  {
    "key": "Key:hashtags",
    "url": "https://resultmaps.neis-one.org/osm-changesets?comment=$1",
    "source": "osmwiki:P8",
    "rank": "normal"
  },
```
- That link expects the text to replace `$1` not to have a hashtag.
- But we apply the substitution verbatim, passing the hashtag.
- We need to remove the hashtag for that substitution to work, which is what you are doing here.

Your solution would fail if we had a similar tag2link rule that did expect the `#`, as it applies to all rules, not only `Key:hashtags`. Do we know of any such rule? I'm guessing the probability is low, as `#` has a special meaning in URLs as you say.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6613#issuecomment-3666315395
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6613/c3666315395 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251217/c0743dc9/attachment.htm>


More information about the rails-dev mailing list