fix: fix unexpected setext heading (#2986)
This commit is contained in:
parent
0743d4adb4
commit
bcc3067087
@ -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]+)*)/,
|
||||
|
9
test/specs/new/setext_blankline.html
Normal file
9
test/specs/new/setext_blankline.html
Normal file
@ -0,0 +1,9 @@
|
||||
<p>a</p>
|
||||
<p>b</p>
|
||||
<p>=</p>
|
||||
|
||||
<p>a</p>
|
||||
<p>b</p>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
11
test/specs/new/setext_blankline.md
Normal file
11
test/specs/new/setext_blankline.md
Normal file
@ -0,0 +1,11 @@
|
||||
a
|
||||
|
||||
b
|
||||
|
||||
=
|
||||
|
||||
a
|
||||
|
||||
b
|
||||
|
||||
-
|
Loading…
x
Reference in New Issue
Block a user