diff --git a/markdown_it/rules_core/linkify.py b/markdown_it/rules_core/linkify.py index efbc9d4c..19140ecd 100644 --- a/markdown_it/rules_core/linkify.py +++ b/markdown_it/rules_core/linkify.py @@ -95,7 +95,9 @@ def linkify(state: StateCore) -> None: urlText = HTTP_RE.sub( "", state.md.normalizeLinkText("http://" + urlText) ) - elif link.schema == "mailto:" and TEST_MAILTO_RE.search(urlText): + elif link.schema == "mailto:" and not TEST_MAILTO_RE.search( + urlText + ): urlText = MAILTO_RE.sub( "", state.md.normalizeLinkText("mailto:" + urlText) ) diff --git a/tests/test_port/fixtures/linkify.md b/tests/test_port/fixtures/linkify.md index 02a23b17..b6e13875 100644 --- a/tests/test_port/fixtures/linkify.md +++ b/tests/test_port/fixtures/linkify.md @@ -155,6 +155,16 @@ mailto:test@example.com
. +emails with a punycode domain +. +test@xn--n3h.net + +mailto:test@xn--n3h.net +. + + +. + typorgapher should not break href .