[openstreetmap/openstreetmap-website] Exclude non-http URLs from tag2link (PR #6587)

Minh Nguyễn notifications at github.com
Sun Dec 7 17:32:05 UTC 2025


1ec5 left a comment (openstreetmap/openstreetmap-website#6587)

> In general all the tags processed by tag2link/the linkifying code are external values that we don't have any control over. Are we sure none of them besides URLs contain semi-colons as a legal (non-OSM-list) value?

The reason for special-casing URLs is that we know a URL can validly contain a semicolon and can parse it both ways without any external lookup. By contrast, with a key like `wikipedia=*` or `wikimedia_commons=*`, we technically wouldn’t know if the semicolon serves as a delimiter without calling out to the MediaWiki API. We could employ some heuristics like looking for `;[-a-z]{2,}:`, but this could become a rabbit hole fast. If tag2link provides more information on the heuristics to use, we could adopt a two-pass approach for more keys.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6587/c3622621358 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251207/67e96938/attachment.htm>


More information about the rails-dev mailing list