fix: include single nested parens in emStrong link mask (#3475)

This commit is contained in:
Tony Brix
2024-10-14 22:24:34 -06:00
committed by GitHub
parent b1fd3eafd8
commit 2b7efa8dda
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ const punctuation = edit(/^((?![*_])[\spunctuation])/, 'u')
.replace(/punctuation/g, _punctuation).getRegex();
// sequences em should skip over [title](link), `code`, <html>
const blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
const emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, 'u')
.replace(/punct/g, _punctuation)
+1
View File
@@ -0,0 +1 @@
<p><em><a href="https://example.com?link=with_(underscore)">test</a></em></p>
+1
View File
@@ -0,0 +1 @@
_[test](https://example.com?link=with_(underscore))_