- Timestamp:
- 2020-01-29T20:58:58+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Tag2Link.java
r15711 r15794 137 137 138 138 // Common 139 final boolean valueIsURL = value.matches("^(http:|https:|www\\.).*"); 140 if (key.matches("^(.+[:_])?website([:_].+)?$") && valueIsURL) { 141 linkConsumer.acceptLink(getLinkName(value, key), value); 139 final String validURL = value.startsWith("http:") || value.startsWith("https:") 140 ? value 141 : value.startsWith("www.") 142 ? "http://" + value 143 : null; 144 if (key.matches("^(.+[:_])?website([:_].+)?$") && validURL != null) { 145 linkConsumer.acceptLink(getLinkName(validURL, key), validURL); 142 146 } 143 if (key.matches("^(.+[:_])?source([:_].+)?$") && val ueIsURL) {144 linkConsumer.acceptLink(getLinkName(val ue, key), value);147 if (key.matches("^(.+[:_])?source([:_].+)?$") && validURL != null) { 148 linkConsumer.acceptLink(getLinkName(validURL, key), validURL); 145 149 } 146 if (key.matches("^(.+[:_])?url([:_].+)?$") && val ueIsURL) {147 linkConsumer.acceptLink(getLinkName(val ue, key), value);150 if (key.matches("^(.+[:_])?url([:_].+)?$") && validURL != null) { 151 linkConsumer.acceptLink(getLinkName(validURL, key), validURL); 148 152 } 149 if (key.matches("image") && val ueIsURL) {150 linkConsumer.acceptLink(tr("View image"), val ue);153 if (key.matches("image") && validURL != null) { 154 linkConsumer.acceptLink(tr("View image"), validURL); 151 155 } 152 156
Note:
See TracChangeset
for help on using the changeset viewer.