mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: fix links with square brackets in inline code break wrapping italics (#3785)
This commit is contained in:
+1
-1
@@ -267,7 +267,7 @@ const _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
|
||||
const _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
|
||||
|
||||
// sequences em should skip over [title](link), `code`, <html>
|
||||
const blockSkip = /\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g;
|
||||
const blockSkip = /\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g;
|
||||
|
||||
const emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p><em><a href="http://example.com/_/path"><code>a[b]c</code></a></em></p>
|
||||
@@ -0,0 +1 @@
|
||||
_[`a[b]c`](http://example.com/_/path)_
|
||||
Reference in New Issue
Block a user