diff --git a/src/rules.ts b/src/rules.ts index 81da76a..2ae1b68 100644 --- a/src/rules.ts +++ b/src/rules.ts @@ -162,7 +162,7 @@ const html = edit( + '|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)' // (3) + '|[^\\n]*\\n*|$)' // (4) + '|[^\\n]*\\n*|$)' // (5) -+ '|)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (6) ++ '||$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (6) + '|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (7) open tag + '|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (7) closing tag + ')', 'i') diff --git a/test/specs/new/html_block_tab_after_tag_name.html b/test/specs/new/html_block_tab_after_tag_name.html new file mode 100644 index 0000000..536dd7f --- /dev/null +++ b/test/specs/new/html_block_tab_after_tag_name.html @@ -0,0 +1,15 @@ +
+*stays raw* +
+
+*stays raw* +
+
+*stays raw* +
+
+
+*stays raw* +
+
diff --git a/test/specs/new/html_block_tab_after_tag_name.md b/test/specs/new/html_block_tab_after_tag_name.md new file mode 100644 index 0000000..85d6aae --- /dev/null +++ b/test/specs/new/html_block_tab_after_tag_name.md @@ -0,0 +1,16 @@ +
+*stays raw* +
+ +
+*stays raw* +
+ +
+*stays raw* +
+ +>
+> *stays raw* +>
diff --git a/test/specs/new/html_block_tag_at_end_of_input.html b/test/specs/new/html_block_tag_at_end_of_input.html new file mode 100644 index 0000000..3f54666 --- /dev/null +++ b/test/specs/new/html_block_tag_at_end_of_input.html @@ -0,0 +1,2 @@ +

Paragraph

+