fix: Add patch for mdast-util-gfm-autolink-literal@2.0.1 (#4479)

Compatibility patch for Safari versions below 16.4
This commit is contained in:
a.e.
2025-04-08 18:03:58 +08:00
committed by GitHub
parent 1f5709eda6
commit 431390fe42
3 changed files with 26 additions and 5 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/lib/index.js b/lib/index.js
index c5ca771c24dd914e342f791716a822431ee32b3a..9e9dc090d4be5cf882316ed2eced4c471c40407b 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]
+ [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail]
],
{ignore: ['link', 'linkReference']}
)