Changeset 16774 in josm
- Timestamp:
- 2020-07-15T21:00:18+02:00 (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Tag2Link.java
r16434 r16774 156 156 if (keyMatcher.matches() && valueMatcher.matches()) { 157 157 final String lang = Utils.firstNotEmptyString("en", keyMatcher.group("lang"), valueMatcher.group("lang")); 158 linkConsumer.acceptLink(tr("View Wikipedia article"), "https://" + lang + ".wikipedia.org/wiki/" + valueMatcher.group("article")); 158 final String url = "https://" + lang + ".wikipedia.org/wiki/" + valueMatcher.group("article").replace(' ', '_'); 159 linkConsumer.acceptLink(tr("View Wikipedia article"), url); 159 160 } 160 161 if (key.matches("(.*:)?wikidata")) { -
trunk/test/unit/org/openstreetmap/josm/tools/Tag2LinkTest.java
r16434 r16774 52 52 */ 53 53 @Test 54 public void testWikipedia() { 55 Tag2Link.getLinksForTag("wikipedia", "de:Wohnhausgruppe Herderstraße", this::addLink); 56 checkLinks("View Wikipedia article // https://de.wikipedia.org/wiki/Wohnhausgruppe_Herderstraße"); 57 links.clear(); 58 Tag2Link.getLinksForTag("wikipedia", "de:Stadtbahn Köln#Innenstadttunnel", this::addLink); 59 checkLinks("View Wikipedia article // https://de.wikipedia.org/wiki/Stadtbahn_Köln#Innenstadttunnel"); 60 } 61 62 /** 63 * Unit test of function {@link Tag2Link#getLinksForTag}. 64 */ 65 @Test 54 66 public void testImageCommonsImage() { 55 67 Tag2Link.getLinksForTag("image", "File:Witten Brücke Gasstraße.jpg", this::addLink);
Note:
See TracChangeset
for help on using the changeset viewer.