#21794 closed defect (fixed)
[PATCH] Allow for cases where tags can be URL or key values in Tag2Link
Reported by: | Crashillo | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 22.06 |
Component: | Core tag2link | Version: | |
Keywords: | Cc: |
Description
Since the contact:facebook tag could be filled both using the full url or just the name, the Open facebook.com contextual menu doesn't handle the first ones properly.
If the tag is defined using the full url, the contextual menu doubles the hostname, resulting something like https://www.facebook.com/https://www.facebook.com/FacebookUserName.
So the issue lies in detecting if the tag contains an url, in order to build the link properly.
Attachments (2)
Change History (16)
comment:1 by , 3 years ago
Component: | Core → Core tag2link |
---|
follow-up: 3 comment:2 by , 3 years ago
by , 3 years ago
Attachment: | 21794.patch added |
---|
Check tag value against url formatters, and if the tag value matches one of the url formatters ($1 -> .*), extract the group
follow-up: 4 comment:3 by , 3 years ago
Replying to taylor.smock:
I'm working on a patch for this, but I think we should encourage people to use the
contact:facebook=FacebookUserName
overcontact:facebook=https://www.facebook.com/FacebookUserName
.
+1 I would even add an autofix rule for this.
comment:4 by , 3 years ago
Replying to gaben:
+1 I would even add an autofix rule for this.
I've added a discussion section for encouraging FacebookUserName
over https://www.facebook.com/FacebookUserName
on Talk:Key:contact:facebook. Let us see where the community comes down on it before we add an autofix for it.
comment:5 by , 3 years ago
Summary: | Open facebook links in the context menu → [PATCH] Allow for cases where tags can be URL or key values in Tag2Link |
---|
comment:6 by , 3 years ago
Sure, thanks! :)
The main OSM website needs support as well, as currently it is only processing URLs. If JOSM would do this, other tags can also benefit from the shorter profile ID type values.
comment:7 by , 3 years ago
I would like to add that I pointed facebook since is the most common key; but this issue also happens in twitter and instagram (that I've tested). Any contact:whatever key is quite possible being affected in a similar way
comment:8 by , 3 years ago
@anonymous: I've fixed it for general cases with attachment:21794.2.patch . But only if the URL matches one of the Tag2Link URL formatters.
However, since I was looking at the contact:facebook
example, and Facebook has multiple formatters (of note, one for FB Messenger and one for FB itself), I figured it would be a good idea to kick off a discussion about preferring the profile over the url.
@gaben: Just get people involved in the discussion. Either for or against. The tag has been used since 2014, so I don't want to make any changes without community discussion and support.
comment:11 by , 3 years ago
What about the autofix rule I came up with? Should I create a new ticket?
follow-up: 14 comment:12 by , 3 years ago
Definately a new ticket. It is (largely) unrelated to this one, with the caveat that it was what discovered this problem in the first place.
comment:13 by , 3 years ago
Milestone: | → 22.06 |
---|
comment:14 by , 17 months ago
Replying to taylor.smock:
Definately a new ticket. It is (largely) unrelated to this one, with the caveat that it was what discovered this problem in the first place.
See #23244.
This is interesting.
I'm working on a patch for this, but I think we should encourage people to use the
contact:facebook=FacebookUserName
overcontact:facebook=https://www.facebook.com/FacebookUserName
.The reason for this is as follows:
https://www.facebook.com/$1
https://www.messenger.com/t/$1
https://unavatar.now.sh/facebook/$1
The patch I'm working on goes through the formatter urls, replaces
$1
with(.*)
, and extracts group 1 (in the example,FacebookUserName
from thehttps://
value). This only works on exact matches. If someone addshttps://facebook.com/SomeoneElse
, it will not work ashttps://facebook.com/$1
is not in the formatter urls!