diff --git a/src/rules.ts b/src/rules.ts index 36b50062..f05eedc6 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -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`, -const blockSkip = /\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g; +const blockSkip = /\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g; const emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/; diff --git a/test/specs/new/em_link_brackets.html b/test/specs/new/em_link_brackets.html new file mode 100644 index 00000000..af18d51d --- /dev/null +++ b/test/specs/new/em_link_brackets.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/test/specs/new/em_link_brackets.md b/test/specs/new/em_link_brackets.md new file mode 100644 index 00000000..ed630703 --- /dev/null +++ b/test/specs/new/em_link_brackets.md @@ -0,0 +1 @@ +_[`a[b]c`](http://example.com/_/path)_ \ No newline at end of file