IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java b/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java
|
a
|
b
|
|
| 102 | 102 | if (tr("URL contains an invalid protocol: {0}", (String) null).equals(errMsg)) { |
| 103 | 103 | // Special treatment to allow URLs without protocol. See UrlValidator#isValid |
| 104 | 104 | String proto = validator instanceof EmailValidator ? "mailto://" : "http://"; |
| 105 | | return doValidateTag(p, k, proto+value, validator, code); |
| | 105 | |
| | 106 | final var valueWithProtocol = proto + value; |
| | 107 | if (validator.isValid(valueWithProtocol)) { |
| | 108 | fix = () -> new ChangePropertyCommand(p, k, valueWithProtocol); |
| | 109 | } |
| 106 | 110 | } else if (tr("URL contains an invalid authority: {0}", (String) null).equals(errMsg) |
| 107 | 111 | && value.contains("\\") && validator.isValid(value.replaceAll("\\\\", "/"))) { |
| 108 | 112 | // Special treatment to autofix URLs with backslashes. See UrlValidator#isValid |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/InternetTagsTest.java
|
a
|
b
|
|
| 39 | 39 | */ |
| 40 | 40 | @Test |
| 41 | 41 | void testValidUrls() { |
| 42 | | testUrl("url", "www.domain.com", true); // No protocol |
| 43 | 42 | testUrl("url", "http://josm.openstreetmap.de", true); // Simple HTTP |
| 44 | 43 | testUrl("url", "http://josm.openstreetmap.de/", true); // Simple HTTP + slash |
| 45 | 44 | testUrl("website", "https://www.openstreetmap.org", true); // Simple HTTPS |
| … |
… |
|
| 65 | 64 | */ |
| 66 | 65 | @Test |
| 67 | 66 | void testInvalidUrls() { |
| | 67 | testUrl("url", "www.domain.com", false); // No protocol |
| 68 | 68 | testUrl("url", "something://www.domain.com", false); // invalid protocol |
| 69 | 69 | testUrl("url", "http://www.domain.invalidtld", false); // invalid TLD |
| 70 | 70 | } |