diff --git a/src/rules.ts b/src/rules.ts index 1c6fda25..c49fb832 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -87,7 +87,7 @@ export const block: Record & Record)(?:(?: +(?:\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]+)*)/, diff --git a/test/specs/new/setext_blankline.html b/test/specs/new/setext_blankline.html new file mode 100644 index 00000000..1b3ebc2c --- /dev/null +++ b/test/specs/new/setext_blankline.html @@ -0,0 +1,9 @@ +

a

+

b

+

=

+ +

a

+

b

+ diff --git a/test/specs/new/setext_blankline.md b/test/specs/new/setext_blankline.md new file mode 100644 index 00000000..7214ac62 --- /dev/null +++ b/test/specs/new/setext_blankline.md @@ -0,0 +1,11 @@ +a + +b + += + +a + +b + +-