Skip to content

Commit ad8535c

Browse files
authored
fix: fix stong and em tokens in angle brackets (#3731)
1 parent eb3ad1a commit ad8535c

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/rules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ const _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
267267
const _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
268268

269269
// sequences em should skip over [title](link), `code`, <html>
270-
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
270+
const blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g;
271271

272272
const emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
273273

test/specs/new/angle_brackets.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>1 &lt; 2 <strong>OR</strong> 4 &gt; 3</p>

test/specs/new/angle_brackets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1 < 2 **OR** 4 > 3

0 commit comments

Comments
 (0)