@@ -224,9 +224,9 @@ public function provideHtmlWithOptionalTagsOmitted(): array
224
224
// broken: OPTGROUP end tag omission with OPTGROUP element following
225
225
'OPTGROUP end tag omission at end of list ' => [
226
226
'<select><optgroup><option> 1 </option><option> 2 </option></optgroup> '
227
- . '<optgroup><option> A </option><option> B </option></select> ' ,
227
+ . '<optgroup><option> A </option><option> B </option></select> ' ,
228
228
'<select><optgroup><option> 1 </option><option> 2 </option></optgroup> '
229
- . '<optgroup><option> A </option><option> B </option></optgroup></select> ' ,
229
+ . '<optgroup><option> A </option><option> B </option></optgroup></select> ' ,
230
230
],
231
231
'OPTION end tag omission with OPTION element following ' => [
232
232
'<select><option> 1 <option> 2 </option></select> ' ,
@@ -432,9 +432,9 @@ public function provideContentWithoutHtmlTag(): array
432
432
'BODY element with Content-Type in text ' => ['<body>Content-Type</body> ' ],
433
433
'body content only with Content-Type in text ' => ['<p>Content-Type</p> ' ],
434
434
'BODY element containing Content-Type META tag '
435
- => ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
435
+ => ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
436
436
'body content only with Content-Type META tag '
437
- => ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
437
+ => ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
438
438
];
439
439
}
440
440
@@ -535,22 +535,22 @@ public function provideContentWithoutHeadTag(): array
535
535
'BODY element ' => ['<body></body> ' ],
536
536
'HEADER element ' => ['<header></header> ' ],
537
537
'http-equiv META element (implicit HEAD) '
538
- => ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
538
+ => ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
539
539
'viewport META element (implicit HEAD) '
540
- => ['<meta name="viewport" content="width=device-width, initial-scale=1.0"> ' ],
540
+ => ['<meta name="viewport" content="width=device-width, initial-scale=1.0"> ' ],
541
541
'META element with Content-Type as a value ' => ['<meta name="description" content="Content-Type"> ' ],
542
542
'BODY element with Content-Type in text ' => ['<body>Content-Type</body> ' ],
543
543
'body content only with Content-Type in text ' => ['<p>Content-Type</p> ' ],
544
544
'http-equiv META element within BODY (not allowed) '
545
- => ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
545
+ => ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
546
546
'http-equiv META element after P (implicit BODY, not allowed) '
547
- => ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
547
+ => ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
548
548
'http-equiv META element within P (not allowed) '
549
- => ['<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p> ' ],
549
+ => ['<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p> ' ],
550
550
'viewport META element within P (allowed) '
551
- => ['<p><meta name="viewport" content="width=device-width, initial-scale=1.0"></p> ' ],
551
+ => ['<p><meta name="viewport" content="width=device-width, initial-scale=1.0"></p> ' ],
552
552
'http-equiv META element within HEADER (not allowed) '
553
- => ['<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></header> ' ],
553
+ => ['<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></header> ' ],
554
554
];
555
555
}
556
556
@@ -585,21 +585,21 @@ public function provideContentWithHeadTag(): array
585
585
'HEAD element and HEADER element ' => ['<head></head><header></header> ' ],
586
586
'HEAD element with Content-Type in comment ' => ['<head><!-- Content-Type --></head> ' ],
587
587
'HEAD element with Content-Type as META value '
588
- => ['<head><meta name="description" content="Content-Type"></head> ' ],
588
+ => ['<head><meta name="description" content="Content-Type"></head> ' ],
589
589
'with BODY element with Content-Type in text ' => ['<head></head><body>Content-Type</body> ' ],
590
590
'with implicit body content with Content-Type in text ' => ['<head></head><p>Content-Type</p> ' ],
591
591
'with BODY element containing Content-Type META tag '
592
- => ['<head></head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
592
+ => ['<head></head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
593
593
'with implicit body content with Content-Type META tag '
594
- => ['<head></head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
594
+ => ['<head></head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
595
595
'with end tag omitted and BODY element containing Content-Type META tag '
596
- => ['<head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
596
+ => ['<head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body> ' ],
597
597
'with end tag omitted and implicit body content with Content-Type META tag '
598
- => ['<head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
598
+ => ['<head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
599
599
'with Content-Type META tag after end tag '
600
- => ['<head></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
600
+ => ['<head></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
601
601
'with Content-Type META tag after uppercase end tag '
602
- => ['<HEAD></HEAD><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
602
+ => ['<HEAD></HEAD><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
603
603
];
604
604
}
605
605
@@ -766,15 +766,15 @@ public function normalizedDocumentTypeDataProvider(): array
766
766
'HTML5, extra whitespace ' => ['<!DOCTYPE html > ' , '<!DOCTYPE html> ' ],
767
767
'HTML 4 transitional, uppercase ' => [
768
768
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
769
- . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
769
+ . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
770
770
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
771
- . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
771
+ . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
772
772
],
773
773
'HTML 4 transitional, lowercase ' => [
774
774
'<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
775
- . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
775
+ . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
776
776
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
777
- . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
777
+ . '"http://www.w3.org/TR/REC-html40/loose.dtd"> ' ,
778
778
],
779
779
];
780
780
}
@@ -806,13 +806,13 @@ public function provideMalformedContentTypeMetaTag(): array
806
806
'extra character before META ' => ['<xmeta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
807
807
'extra character after META ' => ['<metax http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
808
808
'extra character before HTTP-EQUIV '
809
- => ['<meta xhttp-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
809
+ => ['<meta xhttp-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
810
810
'extra character after HTTP-EQUIV '
811
- => ['<meta http-equivx="Content-Type" content="text/html; charset=utf-8"> ' ],
811
+ => ['<meta http-equivx="Content-Type" content="text/html; charset=utf-8"> ' ],
812
812
'extra character before CONTENT-TYPE '
813
- => ['<meta http-equiv=xContent-Type content="text/html; charset=utf-8"> ' ],
813
+ => ['<meta http-equiv=xContent-Type content="text/html; charset=utf-8"> ' ],
814
814
'extra character after CONTENT-TYPE '
815
- => ['<meta http-equiv=Content-Typex content="text/html; charset=utf-8"> ' ],
815
+ => ['<meta http-equiv=Content-Typex content="text/html; charset=utf-8"> ' ],
816
816
];
817
817
}
818
818
@@ -854,7 +854,7 @@ public function provideContentTypeMetaTag(): array
854
854
return [
855
855
'double-quoted attribute values ' => ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ' ],
856
856
'single-quoted attribute values '
857
- => ['<meta http-equiv= \'Content-Type \' content= \'text/html; charset=utf-8 \'> ' ],
857
+ => ['<meta http-equiv= \'Content-Type \' content= \'text/html; charset=utf-8 \'> ' ],
858
858
'unquoted attribute values ' => ['<meta http-equiv=Content-Type content=text/html;charset=utf-8> ' ],
859
859
'reverse order attributes ' => ['<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> ' ],
860
860
'without charset ' => ['<meta http-equiv="Content-Type" content="text/html"> ' ],
@@ -887,23 +887,23 @@ public function provideHtmlAroundContentType(): array
887
887
'HEAD element with TAB after start tag ' => ["<head> \t" , '</head> ' ],
888
888
'HEAD element with attribute ' => ['<head lang="en"> ' , '</head> ' ],
889
889
'HTML, HEAD, and BODY with HEADER elements '
890
- => ['<html><head> ' , '</head><body><header></header></body></html> ' ],
890
+ => ['<html><head> ' , '</head><body><header></header></body></html> ' ],
891
891
'HEAD element with comment ' => ['<head><!--Test--> ' , '</head> ' ],
892
892
'HEAD element with commented-out BODY start tag ' => ['<head><!--<body>--> ' , '</head> ' ],
893
893
'HEAD element with BASE element ' => ['<head><base href="https://example.com"/> ' , '</head> ' ],
894
894
'HEAD element with COMMAND element ' => ['<head><command type="command"/> ' , '</head> ' ],
895
895
'HEAD element with LINK element '
896
- => ['<head><link rel="stylesheet" href="https://example.org/css.css"/> ' , '</head> ' ],
896
+ => ['<head><link rel="stylesheet" href="https://example.org/css.css"/> ' , '</head> ' ],
897
897
'HEAD element with another META element ' => ['<head><meta name="title" content="Test"/> ' , '</head> ' ],
898
898
'HEAD element with NOSCRIPT element '
899
- => ['<head><noscript><style>p{color:green}</style></noscript> ' , '</head> ' ],
899
+ => ['<head><noscript><style>p{color:green}</style></noscript> ' , '</head> ' ],
900
900
'HEAD element with SCRIPT element ' => ['<head><script>console.log("Test");</script> ' , '</head> ' ],
901
901
'HEAD element with STYLE element ' => ['<head><style>p{color:green}</style> ' , '</head> ' ],
902
902
'HEAD element with TEMPLATE element '
903
- => ['<head><template id="test"><p>Test</p></template></title> ' , '</head> ' ],
903
+ => ['<head><template id="test"><p>Test</p></template></title> ' , '</head> ' ],
904
904
'HEAD element with TITLE element ' => ['<head><title>Test</title> ' , '</head> ' ],
905
905
'HEAD element with uppercase TEMPLATE element '
906
- => ['<head><TEMPLATE id="test"><p>Test</p></TEMPLATE></title> ' , '</head> ' ],
906
+ => ['<head><TEMPLATE id="test"><p>Test</p></TEMPLATE></title> ' , '</head> ' ],
907
907
'HEAD element with uppercase TITLE element ' => ['<head><TITLE>Test</TITLE> ' , '</head> ' ],
908
908
'Second valid(ish) Content-Type in BODY ' => [
909
909
'<head> ' ,
@@ -1260,8 +1260,8 @@ private static function assertContainsHtml(string $needle, string $haystack, str
1260
1260
$ needleMatcher = \preg_quote ($ needle , '% ' );
1261
1261
$ needleMatcherWithNewlines = (new Preg ())->replace (
1262
1262
'% \\\\<(?:body|ul|dl|optgroup|table|tr|hr '
1263
- . '|/(?:li|dd|dt|option|optgroup|caption|colgroup|thead|tbody|tfoot|tr|td|th '
1264
- . '|p|dl|h[1-6]|menu|ol|pre|table|ul|address|blockquote|div|fieldset|form)) \\\\>% ' ,
1263
+ . '|/(?:li|dd|dt|option|optgroup|caption|colgroup|thead|tbody|tfoot|tr|td|th '
1264
+ . '|p|dl|h[1-6]|menu|ol|pre|table|ul|address|blockquote|div|fieldset|form)) \\\\>% ' ,
1265
1265
'$0 \\n?+ ' ,
1266
1266
$ needleMatcher
1267
1267
);
0 commit comments