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

Regarding that example link to booking.com, that's partially a different 
problem:
- It's a different problem in that the user entered a URL with semicolons, 
which technically they shouldn't have (but I can't blame them).
- It's the same problem in that the incorrectly-splitted strings shouldn't be 
rendered as links.

My impression is that multiple values (semicolon-separated) should be rendered 
differently. Perhaps in different lines, hopefully not all in a single line as 
that's not visually obvious. Then each separate link could get whichever 
treatment we see appropriate: not render as a link, show a warning sign, etc.

Perhaps editors like iD should offer to enter multiple values in separate form 
fields, then join them with semicolons behind the scenes. This way the editor 
could automatically escape the semicolons to `%3B`, avoiding this problem. 
Having said that, in this case the changeset was produced with Level0, so that 
wouldn't have helped.

Looked into why `website=` and `source=` are treated differently. At a 
technical level, the website code delegates some decisions here to 
https://github.com/JOSM/tag2link. This in turn has:
- A special case for `website` 
([code](https://github.com/JOSM/tag2link/blob/e09148b173b7ef6c74988a28e4ef1a218e4cb374/index.json#L3003-L3006)),
 telling it to render the value exactly as given. Therefore `www.example.com` 
remains unchanged, without being automatically prefixed with a scheme.
- No mention of `source`. The default behaviour here is to apply a smart 
linkification using https://github.com/vmg/rinku. (Code rabbit hole starts at 
[browse_tags_helper.rb](https://github.com/openstreetmap/openstreetmap-website/blob/02f458e7e8092b2ebff556d6538bd4a45861de08/app/helpers/browse_tags_helper.rb#L51))
As for whether there's a reason for this, I don't know. I'm guessing it's a 
historic accident, and both should be made to render the same way.

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

Message ID: 
<openstreetmap/openstreetmap-website/issues/6407/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to