Skip to content

Commit 0f8e8af

Browse files
committed
Optimize HTML Block Type 6 pattern with possessive quantifiers
1 parent badbf6c commit 0f8e8af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Util/RegexHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static function getHtmlBlockOpenRegex(int $type): string
192192
case HtmlBlock::TYPE_5_CDATA:
193193
return '/^<!\[CDATA\[/i';
194194
case HtmlBlock::TYPE_6_BLOCK_ELEMENT:
195-
return '%^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)%i';
195+
return '%^</?+(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s++|[/]?+[>]|$)%i';
196196
case HtmlBlock::TYPE_7_MISC_ELEMENT:
197197
return '/^(?:' . self::PARTIAL_OPENTAG . '|' . self::PARTIAL_CLOSETAG . ')\\s*$/i';
198198
default:

0 commit comments

Comments
 (0)