diff --git a/src/rules.ts b/src/rules.ts index af30f961..8b850add 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -96,7 +96,9 @@ export const other = { hrRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)), fencesBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:\`\`\`|~~~)`)), headingBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}#`)), - htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}<(?:[a-z].*>|!--)`, 'i')), + // 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}}(?:)|<(?:script|pre|style|textarea|!--))`, 'i')), blockquoteBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}>`)), }; diff --git a/test/specs/new/html_closing_tag_following_list.html b/test/specs/new/html_closing_tag_following_list.html new file mode 100644 index 00000000..fb381652 --- /dev/null +++ b/test/specs/new/html_closing_tag_following_list.html @@ -0,0 +1,6 @@ +
+ +
diff --git a/test/specs/new/html_closing_tag_following_list.md b/test/specs/new/html_closing_tag_following_list.md new file mode 100644 index 00000000..afcaa139 --- /dev/null +++ b/test/specs/new/html_closing_tag_following_list.md @@ -0,0 +1,5 @@ +
+ +- list item 1 +- list item 2 +
diff --git a/test/specs/new/html_inline_tag_in_list.html b/test/specs/new/html_inline_tag_in_list.html new file mode 100644 index 00000000..12038ed9 --- /dev/null +++ b/test/specs/new/html_inline_tag_in_list.html @@ -0,0 +1,6 @@ + diff --git a/test/specs/new/html_inline_tag_in_list.md b/test/specs/new/html_inline_tag_in_list.md new file mode 100644 index 00000000..87c698c5 --- /dev/null +++ b/test/specs/new/html_inline_tag_in_list.md @@ -0,0 +1,4 @@ +- list item 1 +bold +- list item 2 +span diff --git a/test/specs/new/html_multiline_tag_following_list.html b/test/specs/new/html_multiline_tag_following_list.html new file mode 100644 index 00000000..1d0ef762 --- /dev/null +++ b/test/specs/new/html_multiline_tag_following_list.html @@ -0,0 +1,8 @@ + +
+Content +
diff --git a/test/specs/new/html_multiline_tag_following_list.md b/test/specs/new/html_multiline_tag_following_list.md new file mode 100644 index 00000000..2ae7f8e8 --- /dev/null +++ b/test/specs/new/html_multiline_tag_following_list.md @@ -0,0 +1,6 @@ +- list item 1 +- list item 2 +
+Content +