diff --git a/src/rules.ts b/src/rules.ts
index 81da76a9..6e9c4126 100644
--- a/src/rules.ts
+++ b/src/rules.ts
@@ -101,7 +101,7 @@ export const other = {
headingBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}#`)),
// a list item ends where a paragraph would be interrupted, so this mirrors the
// html start conditions in the paragraph rule below; type 7 is excluded there
- htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:?(?:${_tag})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--))`, 'i')),
+ htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:?(?:${_tag})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| new RegExp(`^ {0,${indent}}>`)),
};
@@ -179,8 +179,8 @@ const createParagraph = (listInterrupt: RegExp) => edit(_paragraph)
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)')
.replace('list', listInterrupt)
- .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)')
- .replace('tag', _tag) // pars can be interrupted by type (6) html blocks
+ .replace('html', ' {0,3}(?:?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)')
- .replace('tag', _tag) // tables can be interrupted by type (6) html blocks
+ .replace('html', ' {0,3}(?:?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| = {
@@ -246,8 +246,8 @@ const blockGfm: Record
Paragraph before an indented comment
+ +Paragraph before a processing instruction
+ +Paragraph before a declaration
+ +Paragraph before CDATA
+ ++diff --git a/test/specs/new/html_block_interrupts_paragraph.md b/test/specs/new/html_block_interrupts_paragraph.md new file mode 100644 index 00000000..5eb3c9d1 --- /dev/null +++ b/test/specs/new/html_block_interrupts_paragraph.md @@ -0,0 +1,20 @@ +Paragraph before an indented div +Paragraph in a blockquote
+++