New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update browse_helper.rb #814
Conversation
Manage name:wikipedia, subject:wikipedia… name:wikidata…
@@ -117,7 +117,8 @@ def wikipedia_link(key, value) | |||
# Some k/v's are wikipedia=http://en.wikipedia.org/wiki/Full%20URL | |||
return nil if value =~ /^https?:\/\// | |||
|
|||
if key == "wikipedia" | |||
# match wikipedia or xxxxx:wikipedia | |||
if key =~ /^(?:.*:)*wikipedia$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here (and on line 158 as well), would it be more efficient to use the String end_with() method? Not tested
Have you looked at the discussion at #788 ? |
Not yet implemented ? So i propose this expression :
|
Didn't we decide against all these extra tags on a previous pull request? |
OK so it was only the etymology thing that was vetoed at that point. But I see now it's expanded to adding lots of wikipedia tags as well! Is there some sort of sane end point to how much metadata people want to try and maintain... |
Sorry english is not my mother language 😉 I understood that the problem was to have multi values for wikidata keys, not extra prefix keys |
I only read the old ticket quickly but I thought the main problem was that we didn't think the etymology tags belonged in OSM in the first place and as a result we thought they shouldn't be nicely rendered as that would just encourage people to add them. |
see this regexp to match all cases : http://regexr.com/39o1g
and
|
@pyrog: The problem isn't that it is not implemented, but that there is no consensus on the question, if those wiki(data|pedia)-tags with prefixes should get linked. In #788 I've already implemented this for wikidata-tags. Please keep in mind, that the tags with prefixes can have multivalues, the simple tags without prefix only have one value. Also only a limited set of tags should be accepted, so things like opperator:wikidata or architekt:wikipedia won't get linked. |
Ok, but I can't see the link on architect:wikidata for this object : http://www.openstreetmap.org/way/219200232
I'am agree with you 😄 |
@pyrog: That's because the pull request #788 is still open. That means that I have proposed this change (just like you with this pull-request), but it hasn't been incorporated in the main OSM website.
As I already mentioned, my pull request only covers the wikidata-tags, not the wikipedia-tags. So I just incorporated the tags proposed in Proposed features/Wikidata. And name:wikidata has neither been proposed, nor is it in use. Instead, the wikidata-version of name:wikipedia is name:etymology:wikidata. If needed, any other wikidata-tag could easily be added later by modifying the RegEx in line 167 of browse_helper.rb accordingly. |
068471f
to
d87ea68
Compare
Manage name:wikipedia, subject:wikipedia… name:wikidata…
Rebase on current openstreetmap/openstreetmap-website (821a22c)
Is #788 a better PR to proceed with? |
@pnorman Obviously I am biased towards #788. But that PR is accompanied by tests and only links a fixed set of wikidata-tags (those mentioned in the wikidata proposal, excluding the etymology-tag) instead of linking all of The only problem, I currently see is, that |
I've merged #788 as that had the better implementation. |
Manage name:wikipedia, subject:wikipedia… name:wikidata…