fix: include single nested parens in emStrong link mask (#3475)
This commit is contained in:
parent
b1fd3eafd8
commit
2b7efa8dda
@ -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
test/specs/new/underscore_link.html
Normal file
1
test/specs/new/underscore_link.html
Normal file
@ -0,0 +1 @@
|
||||
<p><em><a href="https://example.com?link=with_(underscore)">test</a></em></p>
|
1
test/specs/new/underscore_link.md
Normal file
1
test/specs/new/underscore_link.md
Normal file
@ -0,0 +1 @@
|
||||
_[test](https://example.com?link=with_(underscore))_
|
Loading…
x
Reference in New Issue
Block a user