[openstreetmap/openstreetmap-website] website key without "http" links to the OSM website (Issue #6407)
Minh Nguyễn
notifications at github.com
Tue Sep 23 13:23:06 UTC 2025
1ec5 left a comment (openstreetmap/openstreetmap-website#6407)
The [`website=*`](https://wiki.openstreetmap.org/wiki/Key:website) key has long been documented as requiring a protocol for the sake of data consumers, and most data consumers expect it. Validators like Osmose already warn about malformed URLs. iD used to but regressed: openstreetmap/iD#11436. Most users probably copy-paste URLs rather than typing them in manually, but if users find it tedious, the validator warning could come with a button to automatically add a protocol. Arguably, leaving the URL unlinked would be valuable feedback to the mapper that something is wrong.
In principle, `website=*` should be just a single URL, so we don’t have to guess the boundaries of a URL within running text, which can be tricky (think parentheses). However, there are [about 2,200](https://qlever.cs.uni-freiburg.de/osm-planet/bZW8Y7) occurrences of [semicolon-delimited value lists](https://wiki.openstreetmap.org/wiki/Semi-colon_value_separator), which clashes with about [700 occurrences](https://qlever.cs.uni-freiburg.de/osm-planet/AgZe7E) of URLs that might legitimately contain semicolons under RFC 1738.
Incidentally, we’re optimistically linkifying URLs inside other freeform text keys like `source=*`. This works [when there’s a full URL](https://www.openstreetmap.org/way/86216802), and in the very common case that the source is [merely a domain name](https://www.openstreetmap.org/node/1005425725), it seems to be working too. So we do still have the capability of forming a correct link out of a partial URL.
#6197 integrated tag2link, which has [a rule for `website=*` specifically](https://github.com/JOSM/tag2link/blob/e09148b173b7ef6c74988a28e4ef1a218e4cb374/index.json#L3004). As part of the integration, we skip tag2link in favor of the preexisting linkifier if it starts with HTTP or HTTPS:
https://github.com/openstreetmap/openstreetmap-website/blob/8bd509b7caba7b1b17ee508ae7e049938bf398ba/app/helpers/browse_tags_helper.rb#L139-L140
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6407#issuecomment-3324004178
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/6407/3324004178 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250923/378fb8d0/attachment.htm>
More information about the rails-dev
mailing list