mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: include single nested parens in emStrong link mask (#3475)
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p><em><a href="https://example.com?link=with_(underscore)">test</a></em></p>
|
||||
@@ -0,0 +1 @@
|
||||
_[test](https://example.com?link=with_(underscore))_
|
||||
Reference in New Issue
Block a user