Files
deepseek-harness/patches/mdast-util-gfm-autolink-literal@2.0.1.patch
T

15 lines
666 B
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
diff --git a/lib/index.js b/lib/index.js
index c5ca771c24dd914e342f791716a822431ee32b3a..11265b3fe41bb41985f149e2bd8f2fc2b6f85e2e 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -131,7 +131,8 @@ function transformGfmAutolinkLiterals(tree) {
findAndReplace(
tree,
[
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
+ // Non-ASCII punctuation and symbols, such as `。` or `,`, end the path in CJK prose.
+ [/(https?:\/\/|www(?=\.))([-.\w]+)((?:[!-~]|(?![\p{P}\p{S}])[^ \t\r\n])*)/giu, findUrl],
[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail]
],
{ignore: ['link', 'linkReference']}