fix: fix links with square brackets in inline code break wrapping italics (#3785)

This commit is contained in:
Lakshyajeet Singh Goyal
2025-10-06 21:19:22 -06:00
committed by GitHub
parent 302ee59b2b
commit e3c0d3e208
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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_]))/;
+1
View File
@@ -0,0 +1 @@
<p><em><a href="http://example.com/_/path"><code>a[b]c</code></a></em></p>
+1
View File
@@ -0,0 +1 @@
_[`a[b]c`](http://example.com/_/path)_