Skip to content

Commit d6cb31c

Browse files
links: fix mailto: link handling (#1450)
1 parent d1ef089 commit d6cb31c

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Fix: `mailto:name` is correctly identified as external URL again

znai-docs/znai/release-notes/2026.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.85.3
2+
3+
:include-markdowns: 1.85.3
4+
15
# 1.85.2
26

37
:include-markdowns: 1.85.2

znai-utils/src/main/java/org/testingisdocumenting/znai/utils/UrlUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static String concat(String left, String right) {
4747
}
4848

4949
public static boolean isExternal(String url) {
50-
return EXTERNAL_URL_PATTERN.matcher(url).find();
50+
return EXTERNAL_URL_PATTERN.matcher(url).find() || url.startsWith("mailto:");
5151
}
5252

5353
public static String removeAnchor(String url) {

znai-utils/src/test/groovy/org/testingisdocumenting/znai/utils/UrlUtilsTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class UrlUtilsTest {
5252
void "is external"() {
5353
UrlUtils.isExternal("http://hello").should == true
5454
UrlUtils.isExternal("https://hello").should == true
55-
UrlUtils.isExternal("mailto://hello").should == true
55+
UrlUtils.isExternal("mailto:hello").should == true
5656
UrlUtils.isExternal("file://hello.txt").should == true
5757
UrlUtils.isExternal("custom://something").should == true
5858
UrlUtils.isExternal("custom:something").should == false

0 commit comments

Comments
 (0)