Changeset 17006 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2020-09-03T21:50:29+02:00 (4 years ago)
Author:
simon04
Message:

fix #19754 - Tag2Link: support multi-values for wikimedia_commons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Tag2Link.java

    r16839 r17006  
    187187        }
    188188        if (key.matches("(.*:)?wikidata")) {
    189             OsmUtils.splitMultipleValues(value)
    190                     .forEach(q -> linkConsumer.acceptLink(tr("View Wikidata item"), "https://www.wikidata.org/wiki/" + q, imageResource.get()));
     189            OsmUtils.splitMultipleValues(value).forEach(q -> linkConsumer.acceptLink(
     190                    tr("View Wikidata item"), "https://www.wikidata.org/wiki/" + q, imageResource.get()));
    191191        }
    192192        if (key.matches("(.*:)?species")) {
     
    195195        }
    196196        if (key.matches("wikimedia_commons|image") && value.matches("(?i:File):.*")) {
    197             String url = "https://commons.wikimedia.org/wiki/" + value;
    198             linkConsumer.acceptLink(tr("View image on Wikimedia Commons"), url, imageResource.get());
     197            OsmUtils.splitMultipleValues(value).forEach(i -> linkConsumer.acceptLink(
     198                    tr("View image on Wikimedia Commons"), "https://commons.wikimedia.org/wiki/" + i, imageResource.get()));
    199199        }
    200200        if (key.matches("wikimedia_commons|image") && value.matches("(?i:Category):.*")) {
    201             String url = "https://commons.wikimedia.org/wiki/" + value;
    202             linkConsumer.acceptLink(tr("View category on Wikimedia Commons"), url, imageResource.get());
     201            OsmUtils.splitMultipleValues(value).forEach(i -> linkConsumer.acceptLink(
     202                    tr("View category on Wikimedia Commons"), "https://commons.wikimedia.org/wiki/" + i, imageResource.get()));
    203203        }
    204204
Note: See TracChangeset for help on using the changeset viewer.