Skip to content

Commit

Permalink
fix: fix unexpected setext heading (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Sep 15, 2023
1 parent 0743d4a commit bcc3067
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules.ts
Expand Up @@ -87,7 +87,7 @@ export const block: Record<BlockRuleNames, Rule> & Record<BlockSubRuleNames, Rul
+ ')',
def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
table: noopTest,
lheading: /^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
Expand Down
9 changes: 9 additions & 0 deletions test/specs/new/setext_blankline.html
@@ -0,0 +1,9 @@
<p>a</p>
<p>b</p>
<p>=</p>

<p>a</p>
<p>b</p>
<ul>
<li></li>
</ul>
11 changes: 11 additions & 0 deletions test/specs/new/setext_blankline.md
@@ -0,0 +1,11 @@
a

b

=

a

b

-

1 comment on commit bcc3067

@vercel
Copy link

@vercel vercel bot commented on bcc3067 Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.