fix: allow a tab or end of input after a type 6 html block tag name (#4128)

This commit is contained in:
Michał Fox
2026-10-25 23:53:09 -06:00
committed by GitHub
parent 398234ccea
commit e09c40dfc7
5 changed files with 37 additions and 1 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ const html = edit(
+ '|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)' // (3)
+ '|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)' // (4)
+ '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)' // (5)
+ '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (6)
+ '|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\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
+ '|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)' // (7) closing tag
+ ')', 'i')
@@ -0,0 +1,15 @@
<div class="x">
*stays raw*
</div>
<TABLE class="x"><tr><td>
*stays raw*
</td></tr></TABLE>
<div
class="x">
*stays raw*
</div>
<blockquote>
<div class="x">
*stays raw*
</div>
</blockquote>
@@ -0,0 +1,16 @@
<div class="x">
*stays raw*
</div>
<TABLE class="x"><tr><td>
*stays raw*
</td></tr></TABLE>
<div
class="x">
*stays raw*
</div>
> <div class="x">
> *stays raw*
> </div>
@@ -0,0 +1,2 @@
<p>Paragraph</p>
<div
@@ -0,0 +1,3 @@
Paragraph
<div