/
normalize.test.js.snap
263 lines (232 loc) · 7.85 KB
/
normalize.test.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`html normalizer <Label onClick=doClick..">Hello, World</Label> 1`] = `
Object {
"actual": "<Label onClick=\\"doClick..\\" xmlns=\\"http://www.w3.org/1999/xhtml\\">Hello, World</Label>",
"warning": Array [
"[xmldom warning] attribute \\"onClick\\" missed start quot(\\")!!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer <div a=& a="&''" b/> 1`] = `
Object {
"actual": "<div a=\\"&''\\" b=\\"b\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></div>",
"fatalError": Array [
"[xmldom fatalError] Attribute a redefined
@#[line:1,col:1]",
],
"warning": Array [
"[xmldom warning] attribute \\"&\\" missed quot(\\")!!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer <div a=& bb c d=123&&456/> 1`] = `
Object {
"actual": "<div a=\\"&\\" bb=\\"bb\\" c=\\"c\\" d=\\"123&&456\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></div>",
"warning": Array [
"[xmldom warning] attribute \\"&\\" missed quot(\\")!!
@#[line:1,col:1]",
"[xmldom warning] attribute \\"123&&456\\" missed quot(\\")!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer <div test="a<b&&a< c && a>d"></div> 1`] = `
Object {
"actual": "<div test=\\"a<b&&a< c && a>d\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></div>",
}
`;
exports[`html normalizer <div test="alert('<br/>')"/> 1`] = `
Object {
"actual": "<div test=\\"alert('<br/>')\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></div>",
}
`;
exports[`html normalizer <div>&<123&456<789;&&</div> 1`] = `
Object {
"actual": "<div xmlns=\\"http://www.w3.org/1999/xhtml\\">&<123&456<789;&&</div>",
"error": Array [
"[xmldom error] element parse error: Error: invalid tagName:789;&&<
@#[line:1,col:22]",
],
}
`;
exports[`html normalizer <div> © ©</div> 1`] = `
Object {
"actual": "<div xmlns=\\"http://www.w3.org/1999/xhtml\\"> ©&nbsp&copy</div>",
}
`;
exports[`html normalizer <div><123e>&<a<br/></div> 1`] = `
Object {
"actual": "<div xmlns=\\"http://www.w3.org/1999/xhtml\\"><123e>&<a<br/></div>",
"error": Array [
"[xmldom error] element parse error: Error: invalid tagName:123e
@#[line:1,col:6]",
"[xmldom error] element parse error: Error: invalid tagName:a<br
@#[line:1,col:13]",
],
}
`;
exports[`html normalizer <html test="123"/> 1`] = `
Object {
"actual": "<html test=\\"123\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
}
`;
exports[`html normalizer <html test="a<b && a>b && '&&&'"/> 1`] = `
Object {
"actual": "<html test=\\"a<b && a>b && '&&&'\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
}
`;
exports[`html normalizer <html xmlns:x="1"><body/></html> 1`] = `
Object {
"actual": "<html xmlns:x=\\"1\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"><body></body></html>",
}
`;
exports[`html normalizer <r><Label onClick="doClick..>Hello, World</Label></r> 1`] = `
Object {
"actual": "<r xmlns=\\"http://www.w3.org/1999/xhtml\\"><Label onClick=\\"doClick..>Hello, World</r>",
"error": Array [
"[xmldom error] element parse error: Error: attribute value no end '\\"' match
@#[line:1,col:4]",
],
}
`;
exports[`html normalizer text/html: script <input type="button" disabled></input> 1`] = `
Object {
"actual": "<input type=\\"button\\" disabled=\\"disabled\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"/>",
}
`;
exports[`html normalizer text/html: script <input type="checkbox" checked></input> 1`] = `
Object {
"actual": "<input type=\\"checkbox\\" checked=\\"checked\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"/>",
}
`;
exports[`html normalizer text/html: script <option selected></option> 1`] = `
Object {
"actual": "<option selected=\\"selected\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></option>",
}
`;
exports[`html normalizer text/html: script <script src="./test.js"/> 1`] = `
Object {
"actual": "<script src=\\"./test.js\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></script>",
}
`;
exports[`html normalizer text/html: script <script>alert(a<b&&c?"<br/>":">>");</script> 1`] = `
Object {
"actual": "<script xmlns=\\"http://www.w3.org/1999/xhtml\\">alert(a<b&&c?\\"<br/>\\":\\">>\\");</script>",
}
`;
exports[`html normalizer text/html: script <script>alert(a<b&&c?"<br>":">>");</script> 1`] = `
Object {
"actual": "<script xmlns=\\"http://www.w3.org/1999/xhtml\\">alert(a<b&&c?\\"<br>\\":\\">>\\");</script>",
}
`;
exports[`html normalizer text/html: script <textarea>alert(a<b&&c?"<br>":">>");</textarea> 1`] = `
Object {
"actual": "<textarea xmlns=\\"http://www.w3.org/1999/xhtml\\">alert(a<b&&c?\\"<br>\\":\\">>\\");</textarea>",
}
`;
exports[`html normalizer text/xml: script <input type="button" disabled></input> 1`] = `
Object {
"actual": "<input type=\\"button\\" disabled=\\"disabled\\"/>",
"warning": Array [
"[xmldom warning] attribute \\"disabled\\" missed value!! \\"disabled\\" instead!!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer text/xml: script <input type="checkbox" checked></input> 1`] = `
Object {
"actual": "<input type=\\"checkbox\\" checked=\\"checked\\"/>",
"warning": Array [
"[xmldom warning] attribute \\"checked\\" missed value!! \\"checked\\" instead!!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer text/xml: script <option selected></option> 1`] = `
Object {
"actual": "<option selected=\\"selected\\"/>",
"warning": Array [
"[xmldom warning] attribute \\"selected\\" missed value!! \\"selected\\" instead!!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer text/xml: script <script src="./test.js"/> 1`] = `
Object {
"actual": "<script src=\\"./test.js\\"/>",
}
`;
exports[`html normalizer text/xml: script <script>alert(a<b&&c?"<br/>":">>");</script> 1`] = `
Object {
"actual": "<script>alert(a<b&&c?\\"<br/>\\":\\">>\\");</script>",
"error": Array [
"[xmldom error] element parse error: Error: attribute value must after \\"=\\"
@#[line:1,col:16]",
],
}
`;
exports[`html normalizer text/xml: script <script>alert(a<b&&c?"<br>":">>");</script> 1`] = `
Object {
"actual": "<script>alert(a<b&&c?\\"<br/>\\":\\">>\\");</script>",
"error": Array [
"[xmldom error] element parse error: Error: attribute value must after \\"=\\"
@#[line:1,col:16]",
],
"warning": Array [
"[xmldom warning] unclosed xml attribute
@#[line:1,col:23]",
],
}
`;
exports[`html normalizer text/xml: script <textarea>alert(a<b&&c?"<br>":">>");</textarea> 1`] = `
Object {
"actual": "<textarea>alert(a<b&&c?\\"<br/>\\":\\">>\\");</textarea>",
"error": Array [
"[xmldom error] element parse error: Error: attribute value must after \\"=\\"
@#[line:1,col:18]",
],
"warning": Array [
"[xmldom warning] unclosed xml attribute
@#[line:1,col:25]",
],
}
`;
exports[`html normalizer unclosed html <html title = 1/> 1`] = `
Object {
"actual": "<html title=\\"1\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
"warning": Array [
"[xmldom warning] attribute \\"1\\" missed quot(\\")!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer unclosed html <html title =1/2></html> 1`] = `
Object {
"actual": "<html title=\\"1/2\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
"warning": Array [
"[xmldom warning] attribute \\"1/2\\" missed quot(\\")!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer unclosed html <html title/> 1`] = `
Object {
"actual": "<html title=\\"title\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
}
`;
exports[`html normalizer unclosed html <html title= 1/> 1`] = `
Object {
"actual": "<html title=\\"1\\" xmlns=\\"http://www.w3.org/1999/xhtml\\"></html>",
"warning": Array [
"[xmldom warning] attribute \\"1\\" missed quot(\\")!
@#[line:1,col:1]",
],
}
`;
exports[`html normalizer unclosed html <html><meta><link><img><br><hr><input></html> 1`] = `
Object {
"actual": "<html xmlns=\\"http://www.w3.org/1999/xhtml\\"><meta/><link/><img/><br/><hr/><input/></html>",
}
`;