From 90091da0e25779e296380e0df92a20e9d6fedd78 Mon Sep 17 00:00:00 2001 From: joyboyguo Date: Wed, 12 Feb 2025 14:22:45 +0800 Subject: [PATCH] fix: use iOS-compatible regex for autolink parsing --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index c5ca771..18d5c1f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -132,7 +132,7 @@ function transformGfmAutolinkLiterals(tree) { tree, [ [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl], - [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail] + [/(?:^|\s|[!"#$%&'()*+,\-./:;<=>?@[\\]^_`{|}~])([-.\\w+]+)@([-\w]+(?:\.[-\w]+)+)/gi, findEmail] ], {ignore: ['link', 'linkReference']} )