@@ -27,8 +27,7 @@ public function contentTypes(): iterable {
27
27
yield 'HTML5, double quotes ' => [
28
28
<<<HTML
29
29
<meta charset="iso-8859-1">
30
- HTML
31
- ,
30
+ HTML ,
32
31
'iso-8859-1 ' ,
33
32
[
34
33
'<meta charset="iso-8859-1"> ' => '<meta charset="placeholder-encoding"> ' ,
@@ -38,8 +37,7 @@ public function contentTypes(): iterable {
38
37
yield 'HTML5, single quotes ' => [
39
38
<<<HTML
40
39
<meta charset='iso-8859-1'>
41
- HTML
42
- ,
40
+ HTML ,
43
41
'iso-8859-1 ' ,
44
42
[
45
43
"<meta charset='iso-8859-1'> " => "<meta charset='placeholder-encoding'> " ,
@@ -49,8 +47,7 @@ public function contentTypes(): iterable {
49
47
yield 'HTML5, unquoted ' => [
50
48
<<<HTML
51
49
<meta charset=iso-8859-1>
52
- HTML
53
- ,
50
+ HTML ,
54
51
'iso-8859-1 ' ,
55
52
[
56
53
'<meta charset=iso-8859-1> ' => '<meta charset=placeholder-encoding> ' ,
@@ -60,8 +57,7 @@ public function contentTypes(): iterable {
60
57
yield 'HTML5, unquoted, spaces around ' => [
61
58
<<<HTML
62
59
<meta charset = iso-8859-1>
63
- HTML
64
- ,
60
+ HTML ,
65
61
'iso-8859-1 ' ,
66
62
[
67
63
'<meta charset = iso-8859-1> ' => '<meta charset=placeholder-encoding> ' ,
@@ -71,8 +67,7 @@ public function contentTypes(): iterable {
71
67
yield 'HTML5, unquoted, extra attributes ' => [
72
68
<<<HTML
73
69
<meta foo charset=iso-8859-1 bar baz="2">
74
- HTML
75
- ,
70
+ HTML ,
76
71
'iso-8859-1 ' ,
77
72
[
78
73
'<meta foo charset=iso-8859-1 bar baz="2"> ' => '<meta foo charset=placeholder-encoding bar baz="2"> ' ,
@@ -82,8 +77,7 @@ public function contentTypes(): iterable {
82
77
yield 'HTML5, random case ' => [
83
78
<<<HTML
84
79
<MeTA chArSEt="ISo-8859-1">
85
- HTML
86
- ,
80
+ HTML ,
87
81
'ISo-8859-1 ' ,
88
82
[
89
83
'<MeTA chArSEt="ISo-8859-1"> ' => '<MeTA charset="placeholder-encoding"> ' ,
@@ -93,8 +87,7 @@ public function contentTypes(): iterable {
93
87
yield '(X)HTML5, unquoted ' => [
94
88
<<<HTML
95
89
<meta charset=iso-8859-1 />
96
- HTML
97
- ,
90
+ HTML ,
98
91
'iso-8859-1 ' ,
99
92
[
100
93
'<meta charset=iso-8859-1 /> ' => '<meta charset=placeholder-encoding /> ' ,
@@ -104,8 +97,7 @@ public function contentTypes(): iterable {
104
97
yield '(X)HTML5, tight ' => [
105
98
<<<HTML
106
99
<meta charset="iso-8859-1"/>
107
- HTML
108
- ,
100
+ HTML ,
109
101
'iso-8859-1 ' ,
110
102
[
111
103
'<meta charset="iso-8859-1"/> ' => '<meta charset="placeholder-encoding"/> ' ,
@@ -117,8 +109,7 @@ public function contentTypes(): iterable {
117
109
yield '(X)HTML5, unquoted, misplaced solidus ' => [
118
110
<<<HTML
119
111
<meta charset=iso-8859-1/>
120
- HTML
121
- ,
112
+ HTML ,
122
113
'iso-8859-1/ ' ,
123
114
[
124
115
'<meta charset=iso-8859-1/> ' => '<meta charset=placeholder-encoding> ' ,
@@ -127,9 +118,8 @@ public function contentTypes(): iterable {
127
118
128
119
yield 'HTML4, double quotes ' => [
129
120
<<<HTML
130
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
131
- HTML
132
- ,
121
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
122
+ HTML ,
133
123
'ISO-8859-1 ' ,
134
124
[
135
125
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> ' => '<meta http-equiv="content-type" content="text/html; charset=placeholder-encoding"> ' ,
@@ -138,9 +128,8 @@ public function contentTypes(): iterable {
138
128
139
129
yield 'HTML4, double quotes, other way around ' => [
140
130
<<<HTML
141
- <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
142
- HTML
143
- ,
131
+ <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
132
+ HTML ,
144
133
'ISO-8859-1 ' ,
145
134
[
146
135
'<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ' => '<meta content="text/html; charset=placeholder-encoding" http-equiv="content-type"> ' ,
@@ -149,9 +138,8 @@ public function contentTypes(): iterable {
149
138
150
139
yield 'HTML4, double quotes, extra attributes, other way around ' => [
151
140
<<<HTML
152
- <meta foo="bar" content="text/html; charset=ISO-8859-1" test middle http-equiv="content-type" after='something'>
153
- HTML
154
- ,
141
+ <meta foo="bar" content="text/html; charset=ISO-8859-1" test middle http-equiv="content-type" after='something'>
142
+ HTML ,
155
143
'ISO-8859-1 ' ,
156
144
[
157
145
'<meta foo="bar" content="text/html; charset=ISO-8859-1" test middle http-equiv="content-type" after= \'something \'> ' => '<meta foo="bar" content="text/html; charset=placeholder-encoding" test middle http-equiv="content-type" after= \'something \'> ' ,
@@ -160,9 +148,8 @@ public function contentTypes(): iterable {
160
148
161
149
yield 'HTML4, single quotes ' => [
162
150
<<<HTML
163
- <meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>
164
- HTML
165
- ,
151
+ <meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>
152
+ HTML ,
166
153
'ISO-8859-1 ' ,
167
154
[
168
155
"<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'> " => "<meta http-equiv='content-type' content='text/html; charset=placeholder-encoding'> " ,
@@ -171,9 +158,8 @@ public function contentTypes(): iterable {
171
158
172
159
yield 'HTML4, unquoted+single quotes ' => [
173
160
<<<HTML
174
- <meta http-equiv=content-type content='text/html; charset=ISO-8859-1'>
175
- HTML
176
- ,
161
+ <meta http-equiv=content-type content='text/html; charset=ISO-8859-1'>
162
+ HTML ,
177
163
'ISO-8859-1 ' ,
178
164
[
179
165
"<meta http-equiv=content-type content='text/html; charset=ISO-8859-1'> " => "<meta http-equiv=content-type content='text/html; charset=placeholder-encoding'> " ,
@@ -183,9 +169,8 @@ public function contentTypes(): iterable {
183
169
// https://httpwg.org/specs/rfc9110.html#field.content-type
184
170
yield 'HTML4, internally quoted, extra parameters ' => [
185
171
<<<HTML
186
- <meta http-equiv=content-type content='text/html;foo;charset="ISO-8859-1";bar'>
187
- HTML
188
- ,
172
+ <meta http-equiv=content-type content='text/html;foo;charset="ISO-8859-1";bar'>
173
+ HTML ,
189
174
'ISO-8859-1 ' ,
190
175
[
191
176
"<meta http-equiv=content-type content='text/html;foo;charset= \"ISO-8859-1 \";bar'> " => "<meta http-equiv=content-type content='text/html; foo; charset=placeholder-encoding; bar'> " ,
@@ -194,9 +179,8 @@ public function contentTypes(): iterable {
194
179
195
180
yield 'HTML4, single quotes+double quotes+spaces around ' => [
196
181
<<<HTML
197
- <meta http-equiv = "content-type" content = "text/html; charset=ISO-8859-1">
198
- HTML
199
- ,
182
+ <meta http-equiv = "content-type" content = "text/html; charset=ISO-8859-1">
183
+ HTML ,
200
184
'ISO-8859-1 ' ,
201
185
[
202
186
'<meta http-equiv = "content-type" content = "text/html; charset=ISO-8859-1"> ' => '<meta http-equiv = "content-type" content="text/html; charset=placeholder-encoding"> ' ,
@@ -205,9 +189,8 @@ public function contentTypes(): iterable {
205
189
206
190
yield 'HTML4, random case ' => [
207
191
<<<HTML
208
- <meTA HTTp-EQuIv="conTeNt-TYpe" CoNTeNt="text/Html; cHArSeT=ISO-8859-1">
209
- HTML
210
- ,
192
+ <meTA HTTp-EQuIv="conTeNt-TYpe" CoNTeNt="text/Html; cHArSeT=ISO-8859-1">
193
+ HTML ,
211
194
'ISO-8859-1 ' ,
212
195
[
213
196
'<meTA HTTp-EQuIv="conTeNt-TYpe" CoNTeNt="text/Html; cHArSeT=ISO-8859-1"> ' => '<meTA HTTp-EQuIv="conTeNt-TYpe" content="text/Html; cHArSeT=placeholder-encoding"> ' ,
@@ -216,9 +199,8 @@ public function contentTypes(): iterable {
216
199
217
200
yield '(X)HTML4 ' => [
218
201
<<<HTML
219
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
220
- HTML
221
- ,
202
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
203
+ HTML ,
222
204
'ISO-8859-1 ' ,
223
205
[
224
206
'<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> ' => '<meta http-equiv="content-type" content="text/html; charset=placeholder-encoding"/> ' ,
@@ -227,11 +209,10 @@ public function contentTypes(): iterable {
227
209
228
210
yield 'multiple declarations ' => [
229
211
<<<HTML
230
- <meta http-equiv="content-type" test content="text/html; charset=ISO-8859-1">
231
- <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
232
- <meta charset=UTF-8>
233
- HTML
234
- ,
212
+ <meta http-equiv="content-type" test content="text/html; charset=ISO-8859-1">
213
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
214
+ <meta charset=UTF-8>
215
+ HTML ,
235
216
'ISO-8859-1 ' ,
236
217
[
237
218
'<meta http-equiv="content-type" test content="text/html; charset=ISO-8859-1"> ' => '<meta http-equiv="content-type" test content="text/html; charset=placeholder-encoding"> ' ,
0 commit comments