diff --git a/index.js b/index.js index 281e6c6..d927ceb 100644 --- a/index.js +++ b/index.js @@ -158,6 +158,11 @@ function findEmail(_, atext, label, match) { return false } + // Do not link if label does not contain a letter. + if (!/[a-z]/i.test(label)) { + return false + } + return { type: 'link', title: null, diff --git a/test/base.html b/test/base.html index 0fab254..b180827 100644 --- a/test/base.html +++ b/test/base.html @@ -53,6 +53,7 @@
Can’t end in an underscore followed by a period: aaa@a.b_.
Can contain an underscore followed by a period: aaa@a.b_.c
+Can't have a domain with no letters: mdast-util-gfm-autolink-literal@1.0.1
Visit www.example.com please.
Visit http://www.example.com please.
diff --git a/test/base.md b/test/base.md index 84ba70e..4154927 100644 --- a/test/base.md +++ b/test/base.md @@ -108,6 +108,8 @@ Can’t end in an underscore followed by a period: aaa@a.b_. Can contain an underscore followed by a period: aaa@a.b_.c +Can't have a domain with no letters: mdast-util-gfm-autolink-literal@1.0.1 + ## Link text should not be expanded [Visit www.example.com](http://www.example.com) please.