selma 0.0.7-aarch64-linux → 0.1.0-aarch64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/selma/3.1/selma.so +0 -0
- data/lib/selma/3.2/selma.so +0 -0
- data/lib/selma/version.rb +1 -1
- metadata +3 -46
- data/ext/selma/Cargo.toml +0 -14
- data/ext/selma/_util.rb +0 -102
- data/ext/selma/extconf.rb +0 -6
- data/ext/selma/src/html/element.rs +0 -254
- data/ext/selma/src/html/end_tag.rs +0 -35
- data/ext/selma/src/html/text_chunk.rs +0 -113
- data/ext/selma/src/html.rs +0 -19
- data/ext/selma/src/lib.rs +0 -50
- data/ext/selma/src/native_ref_wrap.rs +0 -79
- data/ext/selma/src/rewriter.rs +0 -429
- data/ext/selma/src/sanitizer.rs +0 -607
- data/ext/selma/src/selector.rs +0 -112
- data/ext/selma/src/tags.rs +0 -1136
- data/ext/selma/src/wrapped_struct.rs +0 -92
- data/selma.gemspec +0 -41
data/ext/selma/src/tags.rs
DELETED
@@ -1,1136 +0,0 @@
|
|
1
|
-
use enum_iterator::{all, Sequence};
|
2
|
-
use lol_html::html_content::Element;
|
3
|
-
|
4
|
-
#[derive(Copy, Clone)]
|
5
|
-
pub struct Tag {
|
6
|
-
pub name: &'static str,
|
7
|
-
pub index: usize,
|
8
|
-
// Note that while lol_html::Element has `.is_self_closing()`, it's not
|
9
|
-
// accurate. For example, `<br>` is self-closing, but not explicitly as such (`<br/>`),
|
10
|
-
// so it's not considered self-closing by lol_html. We need to know this when removing
|
11
|
-
// tags and text, so we need to track it ourselves.
|
12
|
-
pub self_closing: bool,
|
13
|
-
}
|
14
|
-
|
15
|
-
#[derive(Copy, Clone, Sequence)]
|
16
|
-
pub enum HTMLTag {
|
17
|
-
HTML = 0,
|
18
|
-
HEAD,
|
19
|
-
TITLE,
|
20
|
-
BASE,
|
21
|
-
LINK,
|
22
|
-
META,
|
23
|
-
STYLE,
|
24
|
-
SCRIPT,
|
25
|
-
NOSCRIPT,
|
26
|
-
TEMPLATE,
|
27
|
-
BODY,
|
28
|
-
ARTICLE,
|
29
|
-
SECTION,
|
30
|
-
NAV,
|
31
|
-
ASIDE,
|
32
|
-
H1,
|
33
|
-
H2,
|
34
|
-
H3,
|
35
|
-
H4,
|
36
|
-
H5,
|
37
|
-
H6,
|
38
|
-
HGROUP,
|
39
|
-
HEADER,
|
40
|
-
FOOTER,
|
41
|
-
ADDRESS,
|
42
|
-
P,
|
43
|
-
HR,
|
44
|
-
PRE,
|
45
|
-
BLOCKQUOTE,
|
46
|
-
OL,
|
47
|
-
UL,
|
48
|
-
LI,
|
49
|
-
DL,
|
50
|
-
DT,
|
51
|
-
DD,
|
52
|
-
FIGURE,
|
53
|
-
FIGCAPTION,
|
54
|
-
MAIN,
|
55
|
-
DIV,
|
56
|
-
A,
|
57
|
-
EM,
|
58
|
-
STRONG,
|
59
|
-
SMALL,
|
60
|
-
S,
|
61
|
-
CITE,
|
62
|
-
Q,
|
63
|
-
DFN,
|
64
|
-
ABBR,
|
65
|
-
DATA,
|
66
|
-
TIME,
|
67
|
-
CODE,
|
68
|
-
VAR,
|
69
|
-
SAMP,
|
70
|
-
KBD,
|
71
|
-
SUB,
|
72
|
-
SUP,
|
73
|
-
I,
|
74
|
-
B,
|
75
|
-
U,
|
76
|
-
MARK,
|
77
|
-
RUBY,
|
78
|
-
RT,
|
79
|
-
RP,
|
80
|
-
BDI,
|
81
|
-
BDO,
|
82
|
-
SPAN,
|
83
|
-
BR,
|
84
|
-
WBR,
|
85
|
-
INS,
|
86
|
-
DEL,
|
87
|
-
IMAGE,
|
88
|
-
IMG,
|
89
|
-
IFRAME,
|
90
|
-
EMBED,
|
91
|
-
OBJECT,
|
92
|
-
PARAM,
|
93
|
-
VIDEO,
|
94
|
-
AUDIO,
|
95
|
-
SOURCE,
|
96
|
-
TRACK,
|
97
|
-
CANVAS,
|
98
|
-
MAP,
|
99
|
-
AREA,
|
100
|
-
MATH,
|
101
|
-
MI,
|
102
|
-
MO,
|
103
|
-
MN,
|
104
|
-
MS,
|
105
|
-
MTEXT,
|
106
|
-
MGLYPH,
|
107
|
-
MALIGNMARK,
|
108
|
-
ANNOTATION, // Gumbo calls this "GUMBO_TAG_ANNOTATION_XML"
|
109
|
-
SVG,
|
110
|
-
FOREIGNOBJECT,
|
111
|
-
DESC,
|
112
|
-
TABLE,
|
113
|
-
CAPTION,
|
114
|
-
COLGROUP,
|
115
|
-
COL,
|
116
|
-
TBODY,
|
117
|
-
THEAD,
|
118
|
-
TFOOT,
|
119
|
-
TR,
|
120
|
-
TD,
|
121
|
-
TH,
|
122
|
-
FORM,
|
123
|
-
FIELDSET,
|
124
|
-
LEGEND,
|
125
|
-
LABEL,
|
126
|
-
INPUT,
|
127
|
-
BUTTON,
|
128
|
-
SELECT,
|
129
|
-
DATALIST,
|
130
|
-
OPTGROUP,
|
131
|
-
OPTION,
|
132
|
-
TEXTAREA,
|
133
|
-
KEYGEN,
|
134
|
-
OUTPUT,
|
135
|
-
PROGRESS,
|
136
|
-
METER,
|
137
|
-
DETAILS,
|
138
|
-
SUMMARY,
|
139
|
-
MENU,
|
140
|
-
MENUITEM,
|
141
|
-
APPLET,
|
142
|
-
ACRONYM,
|
143
|
-
BGSOUND,
|
144
|
-
DIR,
|
145
|
-
FRAME,
|
146
|
-
FRAMESET,
|
147
|
-
NOFRAMES,
|
148
|
-
LISTING,
|
149
|
-
XMP,
|
150
|
-
NEXTID,
|
151
|
-
NOEMBED,
|
152
|
-
PLAINTEXT,
|
153
|
-
RB,
|
154
|
-
STRIKE,
|
155
|
-
BASEFONT,
|
156
|
-
BIG,
|
157
|
-
BLINK,
|
158
|
-
CENTER,
|
159
|
-
FONT,
|
160
|
-
MARQUEE,
|
161
|
-
MULTICOL,
|
162
|
-
NOBR,
|
163
|
-
SPACER,
|
164
|
-
TT,
|
165
|
-
RTC,
|
166
|
-
DIALOG,
|
167
|
-
UNKNOWN,
|
168
|
-
}
|
169
|
-
|
170
|
-
impl Tag {
|
171
|
-
pub const TAG_COUNT: usize = 151;
|
172
|
-
|
173
|
-
/// Identifies whether this is an HTML tag whose contents
|
174
|
-
/// are considered "text nodes", and thus, must be removed
|
175
|
-
pub fn has_text_content(tag: Tag) -> bool {
|
176
|
-
tag.index == HTMLTag::SCRIPT as usize
|
177
|
-
|| tag.index == HTMLTag::STYLE as usize
|
178
|
-
|| tag.index == HTMLTag::MATH as usize
|
179
|
-
|| tag.index == HTMLTag::SVG as usize
|
180
|
-
}
|
181
|
-
|
182
|
-
/// Is this tag an `<iframe>`?
|
183
|
-
pub fn is_iframe(tag: Tag) -> bool {
|
184
|
-
tag.index == HTMLTag::IFRAME as usize
|
185
|
-
}
|
186
|
-
|
187
|
-
/// Is this tag a `<meta>`?
|
188
|
-
pub fn is_meta(tag: Tag) -> bool {
|
189
|
-
tag.index == HTMLTag::META as usize
|
190
|
-
}
|
191
|
-
|
192
|
-
/// Is this tag something which needs to be removed?
|
193
|
-
pub fn is_tag_escapeworthy(tag: Tag) -> bool {
|
194
|
-
tag.index == HTMLTag::TITLE as usize
|
195
|
-
|| tag.index == HTMLTag::IFRAME as usize
|
196
|
-
|| tag.index == HTMLTag::MATH as usize
|
197
|
-
|| tag.index == HTMLTag::NOEMBED as usize
|
198
|
-
|| tag.index == HTMLTag::NOFRAMES as usize
|
199
|
-
|| tag.index == HTMLTag::NOSCRIPT as usize
|
200
|
-
|| tag.index == HTMLTag::PLAINTEXT as usize
|
201
|
-
|| tag.index == HTMLTag::SCRIPT as usize
|
202
|
-
|| tag.index == HTMLTag::STYLE as usize
|
203
|
-
|| tag.index == HTMLTag::SVG as usize
|
204
|
-
|| tag.index == HTMLTag::TEXTAREA as usize
|
205
|
-
|| tag.index == HTMLTag::XMP as usize
|
206
|
-
}
|
207
|
-
|
208
|
-
pub const ESCAPEWORTHY_TAGS_CSS: &str =
|
209
|
-
"title, textarea, style, xmp, iframe, noembed, noframes, script, plaintext";
|
210
|
-
|
211
|
-
pub fn html_tags() -> Vec<HTMLTag> {
|
212
|
-
all::<HTMLTag>().collect::<Vec<_>>()
|
213
|
-
}
|
214
|
-
|
215
|
-
pub fn tag_from_element(element: &mut Element) -> Tag {
|
216
|
-
Self::tag_from_tag_name(element.tag_name().to_lowercase().as_str())
|
217
|
-
}
|
218
|
-
|
219
|
-
pub fn tag_from_tag_name(tag_name: &str) -> Tag {
|
220
|
-
{
|
221
|
-
match tag_name {
|
222
|
-
"html" => Tag {
|
223
|
-
name: "html",
|
224
|
-
index: 0,
|
225
|
-
self_closing: false,
|
226
|
-
},
|
227
|
-
"head" => Tag {
|
228
|
-
name: "head",
|
229
|
-
index: 1,
|
230
|
-
self_closing: false,
|
231
|
-
},
|
232
|
-
"title" => Tag {
|
233
|
-
name: "title",
|
234
|
-
index: 2,
|
235
|
-
self_closing: false,
|
236
|
-
},
|
237
|
-
"base" => Tag {
|
238
|
-
name: "base",
|
239
|
-
index: 3,
|
240
|
-
self_closing: true,
|
241
|
-
},
|
242
|
-
"link" => Tag {
|
243
|
-
name: "link",
|
244
|
-
index: 4,
|
245
|
-
self_closing: true,
|
246
|
-
},
|
247
|
-
"meta" => Tag {
|
248
|
-
name: "meta",
|
249
|
-
index: 5,
|
250
|
-
self_closing: true,
|
251
|
-
},
|
252
|
-
"style" => Tag {
|
253
|
-
name: "style",
|
254
|
-
index: 6,
|
255
|
-
self_closing: false,
|
256
|
-
},
|
257
|
-
"script" => Tag {
|
258
|
-
name: "script",
|
259
|
-
index: 7,
|
260
|
-
self_closing: false,
|
261
|
-
},
|
262
|
-
"noscript" => Tag {
|
263
|
-
name: "noscript",
|
264
|
-
index: 8,
|
265
|
-
self_closing: false,
|
266
|
-
},
|
267
|
-
"template" => Tag {
|
268
|
-
name: "template",
|
269
|
-
index: 9,
|
270
|
-
self_closing: false,
|
271
|
-
},
|
272
|
-
"body" => Tag {
|
273
|
-
name: "body",
|
274
|
-
index: 10,
|
275
|
-
self_closing: false,
|
276
|
-
},
|
277
|
-
"article" => Tag {
|
278
|
-
name: "article",
|
279
|
-
index: 11,
|
280
|
-
self_closing: false,
|
281
|
-
},
|
282
|
-
"section" => Tag {
|
283
|
-
name: "section",
|
284
|
-
index: 12,
|
285
|
-
self_closing: false,
|
286
|
-
},
|
287
|
-
"nav" => Tag {
|
288
|
-
name: "nav",
|
289
|
-
index: 13,
|
290
|
-
self_closing: false,
|
291
|
-
},
|
292
|
-
"aside" => Tag {
|
293
|
-
name: "aside",
|
294
|
-
index: 14,
|
295
|
-
self_closing: false,
|
296
|
-
},
|
297
|
-
"h1" => Tag {
|
298
|
-
name: "h1",
|
299
|
-
index: 15,
|
300
|
-
self_closing: false,
|
301
|
-
},
|
302
|
-
"h2" => Tag {
|
303
|
-
name: "h2",
|
304
|
-
index: 16,
|
305
|
-
self_closing: false,
|
306
|
-
},
|
307
|
-
"h3" => Tag {
|
308
|
-
name: "h3",
|
309
|
-
index: 17,
|
310
|
-
self_closing: false,
|
311
|
-
},
|
312
|
-
"h4" => Tag {
|
313
|
-
name: "h4",
|
314
|
-
index: 18,
|
315
|
-
self_closing: false,
|
316
|
-
},
|
317
|
-
"h5" => Tag {
|
318
|
-
name: "h5",
|
319
|
-
index: 19,
|
320
|
-
self_closing: false,
|
321
|
-
},
|
322
|
-
"h6" => Tag {
|
323
|
-
name: "h6",
|
324
|
-
index: 20,
|
325
|
-
self_closing: false,
|
326
|
-
},
|
327
|
-
"hgroup" => Tag {
|
328
|
-
name: "hgroup",
|
329
|
-
index: 21,
|
330
|
-
self_closing: false,
|
331
|
-
},
|
332
|
-
"header" => Tag {
|
333
|
-
name: "header",
|
334
|
-
index: 22,
|
335
|
-
self_closing: false,
|
336
|
-
},
|
337
|
-
"footer" => Tag {
|
338
|
-
name: "footer",
|
339
|
-
index: 23,
|
340
|
-
self_closing: false,
|
341
|
-
},
|
342
|
-
"address" => Tag {
|
343
|
-
name: "address",
|
344
|
-
index: 24,
|
345
|
-
self_closing: false,
|
346
|
-
},
|
347
|
-
"p" => Tag {
|
348
|
-
name: "p",
|
349
|
-
index: 25,
|
350
|
-
self_closing: false,
|
351
|
-
},
|
352
|
-
"hr" => Tag {
|
353
|
-
name: "hr",
|
354
|
-
index: 26,
|
355
|
-
self_closing: true,
|
356
|
-
},
|
357
|
-
"pre" => Tag {
|
358
|
-
name: "pre",
|
359
|
-
index: 27,
|
360
|
-
self_closing: false,
|
361
|
-
},
|
362
|
-
"blockquote" => Tag {
|
363
|
-
name: "blockquote",
|
364
|
-
index: 28,
|
365
|
-
self_closing: false,
|
366
|
-
},
|
367
|
-
"ol" => Tag {
|
368
|
-
name: "ol",
|
369
|
-
index: 29,
|
370
|
-
self_closing: false,
|
371
|
-
},
|
372
|
-
"ul" => Tag {
|
373
|
-
name: "ul",
|
374
|
-
index: 30,
|
375
|
-
self_closing: false,
|
376
|
-
},
|
377
|
-
"li" => Tag {
|
378
|
-
name: "li",
|
379
|
-
index: 31,
|
380
|
-
self_closing: false,
|
381
|
-
},
|
382
|
-
"dl" => Tag {
|
383
|
-
name: "dl",
|
384
|
-
index: 32,
|
385
|
-
self_closing: false,
|
386
|
-
},
|
387
|
-
"dt" => Tag {
|
388
|
-
name: "dt",
|
389
|
-
index: 33,
|
390
|
-
self_closing: false,
|
391
|
-
},
|
392
|
-
"dd" => Tag {
|
393
|
-
name: "dd",
|
394
|
-
index: 34,
|
395
|
-
self_closing: false,
|
396
|
-
},
|
397
|
-
"figure" => Tag {
|
398
|
-
name: "figure",
|
399
|
-
index: 35,
|
400
|
-
self_closing: false,
|
401
|
-
},
|
402
|
-
"figcaption" => Tag {
|
403
|
-
name: "figcaption",
|
404
|
-
index: 36,
|
405
|
-
self_closing: false,
|
406
|
-
},
|
407
|
-
"main" => Tag {
|
408
|
-
name: "main",
|
409
|
-
index: 37,
|
410
|
-
self_closing: false,
|
411
|
-
},
|
412
|
-
"div" => Tag {
|
413
|
-
name: "div",
|
414
|
-
index: 38,
|
415
|
-
self_closing: false,
|
416
|
-
},
|
417
|
-
"a" => Tag {
|
418
|
-
name: "a",
|
419
|
-
index: 39,
|
420
|
-
self_closing: false,
|
421
|
-
},
|
422
|
-
"em" => Tag {
|
423
|
-
name: "em",
|
424
|
-
index: 40,
|
425
|
-
self_closing: false,
|
426
|
-
},
|
427
|
-
"strong" => Tag {
|
428
|
-
name: "strong",
|
429
|
-
index: 41,
|
430
|
-
self_closing: false,
|
431
|
-
},
|
432
|
-
"small" => Tag {
|
433
|
-
name: "small",
|
434
|
-
index: 42,
|
435
|
-
self_closing: false,
|
436
|
-
},
|
437
|
-
"s" => Tag {
|
438
|
-
name: "s",
|
439
|
-
index: 43,
|
440
|
-
self_closing: false,
|
441
|
-
},
|
442
|
-
"cite" => Tag {
|
443
|
-
name: "cite",
|
444
|
-
index: 44,
|
445
|
-
self_closing: false,
|
446
|
-
},
|
447
|
-
"q" => Tag {
|
448
|
-
name: "q",
|
449
|
-
index: 45,
|
450
|
-
self_closing: false,
|
451
|
-
},
|
452
|
-
"dfn" => Tag {
|
453
|
-
name: "dfn",
|
454
|
-
index: 46,
|
455
|
-
self_closing: false,
|
456
|
-
},
|
457
|
-
"abbr" => Tag {
|
458
|
-
name: "abbr",
|
459
|
-
index: 47,
|
460
|
-
self_closing: false,
|
461
|
-
},
|
462
|
-
"data" => Tag {
|
463
|
-
name: "data",
|
464
|
-
index: 48,
|
465
|
-
self_closing: false,
|
466
|
-
},
|
467
|
-
"time" => Tag {
|
468
|
-
name: "time",
|
469
|
-
index: 49,
|
470
|
-
self_closing: false,
|
471
|
-
},
|
472
|
-
"code" => Tag {
|
473
|
-
name: "code",
|
474
|
-
index: 50,
|
475
|
-
self_closing: false,
|
476
|
-
},
|
477
|
-
"var" => Tag {
|
478
|
-
name: "var",
|
479
|
-
index: 51,
|
480
|
-
self_closing: false,
|
481
|
-
},
|
482
|
-
"samp" => Tag {
|
483
|
-
name: "samp",
|
484
|
-
index: 52,
|
485
|
-
self_closing: false,
|
486
|
-
},
|
487
|
-
"kbd" => Tag {
|
488
|
-
name: "kbd",
|
489
|
-
index: 53,
|
490
|
-
self_closing: false,
|
491
|
-
},
|
492
|
-
"sub" => Tag {
|
493
|
-
name: "sub",
|
494
|
-
index: 54,
|
495
|
-
self_closing: false,
|
496
|
-
},
|
497
|
-
"sup" => Tag {
|
498
|
-
name: "sup",
|
499
|
-
index: 55,
|
500
|
-
self_closing: false,
|
501
|
-
},
|
502
|
-
"i" => Tag {
|
503
|
-
name: "i",
|
504
|
-
index: 56,
|
505
|
-
self_closing: false,
|
506
|
-
},
|
507
|
-
"b" => Tag {
|
508
|
-
name: "b",
|
509
|
-
index: 57,
|
510
|
-
self_closing: false,
|
511
|
-
},
|
512
|
-
"u" => Tag {
|
513
|
-
name: "u",
|
514
|
-
index: 58,
|
515
|
-
self_closing: false,
|
516
|
-
},
|
517
|
-
"mark" => Tag {
|
518
|
-
name: "mark",
|
519
|
-
index: 59,
|
520
|
-
self_closing: false,
|
521
|
-
},
|
522
|
-
"ruby" => Tag {
|
523
|
-
name: "ruby",
|
524
|
-
index: 60,
|
525
|
-
self_closing: false,
|
526
|
-
},
|
527
|
-
"rt" => Tag {
|
528
|
-
name: "rt",
|
529
|
-
index: 61,
|
530
|
-
self_closing: false,
|
531
|
-
},
|
532
|
-
"rp" => Tag {
|
533
|
-
name: "rp",
|
534
|
-
index: 62,
|
535
|
-
self_closing: false,
|
536
|
-
},
|
537
|
-
"bdi" => Tag {
|
538
|
-
name: "bdi",
|
539
|
-
index: 63,
|
540
|
-
self_closing: false,
|
541
|
-
},
|
542
|
-
"bdo" => Tag {
|
543
|
-
name: "bdo",
|
544
|
-
index: 64,
|
545
|
-
self_closing: false,
|
546
|
-
},
|
547
|
-
"span" => Tag {
|
548
|
-
name: "span",
|
549
|
-
index: 65,
|
550
|
-
self_closing: false,
|
551
|
-
},
|
552
|
-
"br" => Tag {
|
553
|
-
name: "br",
|
554
|
-
index: 66,
|
555
|
-
self_closing: true,
|
556
|
-
},
|
557
|
-
"wbr" => Tag {
|
558
|
-
name: "wbr",
|
559
|
-
index: 67,
|
560
|
-
self_closing: true,
|
561
|
-
},
|
562
|
-
"ins" => Tag {
|
563
|
-
name: "ins",
|
564
|
-
index: 68,
|
565
|
-
self_closing: false,
|
566
|
-
},
|
567
|
-
"del" => Tag {
|
568
|
-
name: "del",
|
569
|
-
index: 69,
|
570
|
-
self_closing: false,
|
571
|
-
},
|
572
|
-
"image" => Tag {
|
573
|
-
name: "image",
|
574
|
-
index: 70,
|
575
|
-
self_closing: false,
|
576
|
-
},
|
577
|
-
"img" => Tag {
|
578
|
-
name: "img",
|
579
|
-
index: 71,
|
580
|
-
self_closing: true,
|
581
|
-
},
|
582
|
-
"iframe" => Tag {
|
583
|
-
name: "iframe",
|
584
|
-
index: 72,
|
585
|
-
self_closing: false,
|
586
|
-
},
|
587
|
-
"embed" => Tag {
|
588
|
-
name: "embed",
|
589
|
-
index: 73,
|
590
|
-
self_closing: true,
|
591
|
-
},
|
592
|
-
"object" => Tag {
|
593
|
-
name: "object",
|
594
|
-
index: 74,
|
595
|
-
self_closing: false,
|
596
|
-
},
|
597
|
-
"param" => Tag {
|
598
|
-
name: "param",
|
599
|
-
index: 75,
|
600
|
-
self_closing: true,
|
601
|
-
},
|
602
|
-
"video" => Tag {
|
603
|
-
name: "video",
|
604
|
-
index: 76,
|
605
|
-
self_closing: false,
|
606
|
-
},
|
607
|
-
"audio" => Tag {
|
608
|
-
name: "audio",
|
609
|
-
index: 77,
|
610
|
-
self_closing: false,
|
611
|
-
},
|
612
|
-
"source" => Tag {
|
613
|
-
name: "source",
|
614
|
-
index: 78,
|
615
|
-
self_closing: true,
|
616
|
-
},
|
617
|
-
"track" => Tag {
|
618
|
-
name: "track",
|
619
|
-
index: 79,
|
620
|
-
self_closing: true,
|
621
|
-
},
|
622
|
-
"canvas" => Tag {
|
623
|
-
name: "canvas",
|
624
|
-
index: 80,
|
625
|
-
self_closing: false,
|
626
|
-
},
|
627
|
-
"map" => Tag {
|
628
|
-
name: "map",
|
629
|
-
index: 81,
|
630
|
-
self_closing: false,
|
631
|
-
},
|
632
|
-
"area" => Tag {
|
633
|
-
name: "area",
|
634
|
-
index: 82,
|
635
|
-
self_closing: true,
|
636
|
-
},
|
637
|
-
"math" => Tag {
|
638
|
-
name: "math",
|
639
|
-
index: 83,
|
640
|
-
self_closing: false,
|
641
|
-
},
|
642
|
-
"mi" => Tag {
|
643
|
-
name: "mi",
|
644
|
-
index: 84,
|
645
|
-
self_closing: false,
|
646
|
-
},
|
647
|
-
"mo" => Tag {
|
648
|
-
name: "mo",
|
649
|
-
index: 85,
|
650
|
-
self_closing: false,
|
651
|
-
},
|
652
|
-
"mn" => Tag {
|
653
|
-
name: "mn",
|
654
|
-
index: 86,
|
655
|
-
self_closing: false,
|
656
|
-
},
|
657
|
-
"ms" => Tag {
|
658
|
-
name: "ms",
|
659
|
-
index: 87,
|
660
|
-
self_closing: false,
|
661
|
-
},
|
662
|
-
"mtext" => Tag {
|
663
|
-
name: "mtext",
|
664
|
-
index: 88,
|
665
|
-
self_closing: false,
|
666
|
-
},
|
667
|
-
"mglyph" => Tag {
|
668
|
-
name: "mglyph",
|
669
|
-
index: 89,
|
670
|
-
self_closing: false,
|
671
|
-
},
|
672
|
-
"malignmark" => Tag {
|
673
|
-
name: "malignmark",
|
674
|
-
index: 90,
|
675
|
-
self_closing: false,
|
676
|
-
},
|
677
|
-
"annotation" => Tag {
|
678
|
-
name: "annotation",
|
679
|
-
index: 91,
|
680
|
-
self_closing: false,
|
681
|
-
},
|
682
|
-
"svg" => Tag {
|
683
|
-
name: "svg",
|
684
|
-
index: 92,
|
685
|
-
self_closing: false,
|
686
|
-
},
|
687
|
-
"foreignobject" => Tag {
|
688
|
-
name: "foreignobject",
|
689
|
-
index: 93,
|
690
|
-
self_closing: false,
|
691
|
-
},
|
692
|
-
"desc" => Tag {
|
693
|
-
name: "desc",
|
694
|
-
index: 94,
|
695
|
-
self_closing: false,
|
696
|
-
},
|
697
|
-
"table" => Tag {
|
698
|
-
name: "table",
|
699
|
-
index: 95,
|
700
|
-
self_closing: false,
|
701
|
-
},
|
702
|
-
"caption" => Tag {
|
703
|
-
name: "caption",
|
704
|
-
index: 96,
|
705
|
-
self_closing: false,
|
706
|
-
},
|
707
|
-
"colgroup" => Tag {
|
708
|
-
name: "colgroup",
|
709
|
-
index: 97,
|
710
|
-
self_closing: false,
|
711
|
-
},
|
712
|
-
"col" => Tag {
|
713
|
-
name: "col",
|
714
|
-
index: 98,
|
715
|
-
self_closing: true,
|
716
|
-
},
|
717
|
-
"tbody" => Tag {
|
718
|
-
name: "tbody",
|
719
|
-
index: 99,
|
720
|
-
self_closing: false,
|
721
|
-
},
|
722
|
-
"thead" => Tag {
|
723
|
-
name: "thead",
|
724
|
-
index: 100,
|
725
|
-
self_closing: false,
|
726
|
-
},
|
727
|
-
"tfoot" => Tag {
|
728
|
-
name: "tfoot",
|
729
|
-
index: 101,
|
730
|
-
self_closing: false,
|
731
|
-
},
|
732
|
-
"tr" => Tag {
|
733
|
-
name: "tr",
|
734
|
-
index: 102,
|
735
|
-
self_closing: false,
|
736
|
-
},
|
737
|
-
"td" => Tag {
|
738
|
-
name: "td",
|
739
|
-
index: 103,
|
740
|
-
self_closing: false,
|
741
|
-
},
|
742
|
-
"th" => Tag {
|
743
|
-
name: "th",
|
744
|
-
index: 104,
|
745
|
-
self_closing: false,
|
746
|
-
},
|
747
|
-
"form" => Tag {
|
748
|
-
name: "form",
|
749
|
-
index: 105,
|
750
|
-
self_closing: false,
|
751
|
-
},
|
752
|
-
"fieldset" => Tag {
|
753
|
-
name: "fieldset",
|
754
|
-
index: 106,
|
755
|
-
self_closing: false,
|
756
|
-
},
|
757
|
-
"legend" => Tag {
|
758
|
-
name: "legend",
|
759
|
-
index: 107,
|
760
|
-
self_closing: false,
|
761
|
-
},
|
762
|
-
"label" => Tag {
|
763
|
-
name: "label",
|
764
|
-
index: 108,
|
765
|
-
self_closing: false,
|
766
|
-
},
|
767
|
-
"input" => Tag {
|
768
|
-
name: "input",
|
769
|
-
index: 109,
|
770
|
-
self_closing: true,
|
771
|
-
},
|
772
|
-
"button" => Tag {
|
773
|
-
name: "button",
|
774
|
-
index: 110,
|
775
|
-
self_closing: false,
|
776
|
-
},
|
777
|
-
"select" => Tag {
|
778
|
-
name: "select",
|
779
|
-
index: 111,
|
780
|
-
self_closing: false,
|
781
|
-
},
|
782
|
-
"datalist" => Tag {
|
783
|
-
name: "datalist",
|
784
|
-
index: 112,
|
785
|
-
self_closing: false,
|
786
|
-
},
|
787
|
-
"optgroup" => Tag {
|
788
|
-
name: "optgroup",
|
789
|
-
index: 113,
|
790
|
-
self_closing: false,
|
791
|
-
},
|
792
|
-
"option" => Tag {
|
793
|
-
name: "option",
|
794
|
-
index: 114,
|
795
|
-
self_closing: false,
|
796
|
-
},
|
797
|
-
"textarea" => Tag {
|
798
|
-
name: "textarea",
|
799
|
-
index: 115,
|
800
|
-
self_closing: false,
|
801
|
-
},
|
802
|
-
"keygen" => Tag {
|
803
|
-
name: "keygen",
|
804
|
-
index: 116,
|
805
|
-
self_closing: true,
|
806
|
-
},
|
807
|
-
"output" => Tag {
|
808
|
-
name: "output",
|
809
|
-
index: 117,
|
810
|
-
self_closing: false,
|
811
|
-
},
|
812
|
-
"progress" => Tag {
|
813
|
-
name: "progress",
|
814
|
-
index: 118,
|
815
|
-
self_closing: false,
|
816
|
-
},
|
817
|
-
"meter" => Tag {
|
818
|
-
name: "meter",
|
819
|
-
index: 119,
|
820
|
-
self_closing: false,
|
821
|
-
},
|
822
|
-
"details" => Tag {
|
823
|
-
name: "details",
|
824
|
-
index: 120,
|
825
|
-
self_closing: false,
|
826
|
-
},
|
827
|
-
"summary" => Tag {
|
828
|
-
name: "summary",
|
829
|
-
index: 121,
|
830
|
-
self_closing: false,
|
831
|
-
},
|
832
|
-
"menu" => Tag {
|
833
|
-
name: "menu",
|
834
|
-
index: 122,
|
835
|
-
self_closing: false,
|
836
|
-
},
|
837
|
-
"menuitem" => Tag {
|
838
|
-
name: "menuitem",
|
839
|
-
index: 123,
|
840
|
-
self_closing: true,
|
841
|
-
},
|
842
|
-
"applet" => Tag {
|
843
|
-
name: "applet",
|
844
|
-
index: 124,
|
845
|
-
self_closing: false,
|
846
|
-
},
|
847
|
-
"acronym" => Tag {
|
848
|
-
name: "acronym",
|
849
|
-
index: 125,
|
850
|
-
self_closing: false,
|
851
|
-
},
|
852
|
-
"bgsound" => Tag {
|
853
|
-
name: "bgsound",
|
854
|
-
index: 126,
|
855
|
-
self_closing: true,
|
856
|
-
},
|
857
|
-
"dir" => Tag {
|
858
|
-
name: "dir",
|
859
|
-
index: 127,
|
860
|
-
self_closing: false,
|
861
|
-
},
|
862
|
-
"frame" => Tag {
|
863
|
-
name: "frame",
|
864
|
-
index: 128,
|
865
|
-
self_closing: true,
|
866
|
-
},
|
867
|
-
"frameset" => Tag {
|
868
|
-
name: "frameset",
|
869
|
-
index: 129,
|
870
|
-
self_closing: false,
|
871
|
-
},
|
872
|
-
"noframes" => Tag {
|
873
|
-
name: "noframes",
|
874
|
-
index: 130,
|
875
|
-
self_closing: false,
|
876
|
-
},
|
877
|
-
"listing" => Tag {
|
878
|
-
name: "listing",
|
879
|
-
index: 131,
|
880
|
-
self_closing: false,
|
881
|
-
},
|
882
|
-
"xmp" => Tag {
|
883
|
-
name: "xmp",
|
884
|
-
index: 132,
|
885
|
-
self_closing: false,
|
886
|
-
},
|
887
|
-
"nextid" => Tag {
|
888
|
-
name: "nextid",
|
889
|
-
index: 133,
|
890
|
-
self_closing: false,
|
891
|
-
},
|
892
|
-
"noembed" => Tag {
|
893
|
-
name: "noembed",
|
894
|
-
index: 134,
|
895
|
-
self_closing: false,
|
896
|
-
},
|
897
|
-
"plaintext" => Tag {
|
898
|
-
name: "plaintext",
|
899
|
-
index: 135,
|
900
|
-
self_closing: false,
|
901
|
-
},
|
902
|
-
"rb" => Tag {
|
903
|
-
name: "rb",
|
904
|
-
index: 136,
|
905
|
-
self_closing: false,
|
906
|
-
},
|
907
|
-
"strike" => Tag {
|
908
|
-
name: "strike",
|
909
|
-
index: 137,
|
910
|
-
self_closing: false,
|
911
|
-
},
|
912
|
-
"basefont" => Tag {
|
913
|
-
name: "basefont",
|
914
|
-
index: 138,
|
915
|
-
self_closing: true,
|
916
|
-
},
|
917
|
-
"big" => Tag {
|
918
|
-
name: "big",
|
919
|
-
index: 139,
|
920
|
-
self_closing: false,
|
921
|
-
},
|
922
|
-
"blink" => Tag {
|
923
|
-
name: "blink",
|
924
|
-
index: 140,
|
925
|
-
self_closing: false,
|
926
|
-
},
|
927
|
-
"center" => Tag {
|
928
|
-
name: "center",
|
929
|
-
index: 141,
|
930
|
-
self_closing: false,
|
931
|
-
},
|
932
|
-
"font" => Tag {
|
933
|
-
name: "font",
|
934
|
-
index: 142,
|
935
|
-
self_closing: false,
|
936
|
-
},
|
937
|
-
"marquee" => Tag {
|
938
|
-
name: "marquee",
|
939
|
-
index: 143,
|
940
|
-
self_closing: false,
|
941
|
-
},
|
942
|
-
"multicol" => Tag {
|
943
|
-
name: "multicol",
|
944
|
-
index: 144,
|
945
|
-
self_closing: false,
|
946
|
-
},
|
947
|
-
"nobr" => Tag {
|
948
|
-
name: "nobr",
|
949
|
-
index: 145,
|
950
|
-
self_closing: false,
|
951
|
-
},
|
952
|
-
"spacer" => Tag {
|
953
|
-
name: "spacer",
|
954
|
-
index: 146,
|
955
|
-
self_closing: false,
|
956
|
-
},
|
957
|
-
"tt" => Tag {
|
958
|
-
name: "tt",
|
959
|
-
index: 147,
|
960
|
-
self_closing: false,
|
961
|
-
},
|
962
|
-
"rtc" => Tag {
|
963
|
-
name: "rtc",
|
964
|
-
index: 148,
|
965
|
-
self_closing: false,
|
966
|
-
},
|
967
|
-
"dialog" => Tag {
|
968
|
-
name: "dialog",
|
969
|
-
index: 149,
|
970
|
-
self_closing: false,
|
971
|
-
},
|
972
|
-
&_ => Tag {
|
973
|
-
name: "unknown",
|
974
|
-
index: 150,
|
975
|
-
self_closing: false,
|
976
|
-
},
|
977
|
-
}
|
978
|
-
}
|
979
|
-
}
|
980
|
-
|
981
|
-
pub fn element_name_from_enum(html_tag: &HTMLTag) -> &'static str {
|
982
|
-
match html_tag {
|
983
|
-
HTMLTag::HTML => "html",
|
984
|
-
HTMLTag::HEAD => "head",
|
985
|
-
HTMLTag::TITLE => "title",
|
986
|
-
HTMLTag::BASE => "base",
|
987
|
-
HTMLTag::LINK => "link",
|
988
|
-
HTMLTag::META => "meta",
|
989
|
-
HTMLTag::STYLE => "style",
|
990
|
-
HTMLTag::SCRIPT => "script",
|
991
|
-
HTMLTag::NOSCRIPT => "noscript",
|
992
|
-
HTMLTag::TEMPLATE => "template",
|
993
|
-
HTMLTag::BODY => "body",
|
994
|
-
HTMLTag::ARTICLE => "article",
|
995
|
-
HTMLTag::SECTION => "section",
|
996
|
-
HTMLTag::NAV => "nav",
|
997
|
-
HTMLTag::ASIDE => "aside",
|
998
|
-
HTMLTag::H1 => "h1",
|
999
|
-
HTMLTag::H2 => "h2",
|
1000
|
-
HTMLTag::H3 => "h3",
|
1001
|
-
HTMLTag::H4 => "h4",
|
1002
|
-
HTMLTag::H5 => "h5",
|
1003
|
-
HTMLTag::H6 => "h6",
|
1004
|
-
HTMLTag::HGROUP => "hgroup",
|
1005
|
-
HTMLTag::HEADER => "header",
|
1006
|
-
HTMLTag::FOOTER => "footer",
|
1007
|
-
HTMLTag::ADDRESS => "address",
|
1008
|
-
HTMLTag::P => "p",
|
1009
|
-
HTMLTag::HR => "hr",
|
1010
|
-
HTMLTag::PRE => "pre",
|
1011
|
-
HTMLTag::BLOCKQUOTE => "blockquote",
|
1012
|
-
HTMLTag::OL => "ol",
|
1013
|
-
HTMLTag::UL => "ul",
|
1014
|
-
HTMLTag::LI => "li",
|
1015
|
-
HTMLTag::DL => "dl",
|
1016
|
-
HTMLTag::DT => "dt",
|
1017
|
-
HTMLTag::DD => "dd",
|
1018
|
-
HTMLTag::FIGURE => "figure",
|
1019
|
-
HTMLTag::FIGCAPTION => "figcaption",
|
1020
|
-
HTMLTag::MAIN => "main",
|
1021
|
-
HTMLTag::DIV => "div",
|
1022
|
-
HTMLTag::A => "a",
|
1023
|
-
HTMLTag::EM => "em",
|
1024
|
-
HTMLTag::STRONG => "strong",
|
1025
|
-
HTMLTag::SMALL => "small",
|
1026
|
-
HTMLTag::S => "s",
|
1027
|
-
HTMLTag::CITE => "cite",
|
1028
|
-
HTMLTag::Q => "q",
|
1029
|
-
HTMLTag::DFN => "dfn",
|
1030
|
-
HTMLTag::ABBR => "abbr",
|
1031
|
-
HTMLTag::DATA => "data",
|
1032
|
-
HTMLTag::TIME => "time",
|
1033
|
-
HTMLTag::CODE => "code",
|
1034
|
-
HTMLTag::VAR => "var",
|
1035
|
-
HTMLTag::SAMP => "samp",
|
1036
|
-
HTMLTag::KBD => "kbd",
|
1037
|
-
HTMLTag::SUB => "sub",
|
1038
|
-
HTMLTag::SUP => "sup",
|
1039
|
-
HTMLTag::I => "i",
|
1040
|
-
HTMLTag::B => "b",
|
1041
|
-
HTMLTag::U => "u",
|
1042
|
-
HTMLTag::MARK => "mark",
|
1043
|
-
HTMLTag::RUBY => "ruby",
|
1044
|
-
HTMLTag::RT => "rt",
|
1045
|
-
HTMLTag::RP => "rp",
|
1046
|
-
HTMLTag::BDI => "bdi",
|
1047
|
-
HTMLTag::BDO => "bdo",
|
1048
|
-
HTMLTag::SPAN => "span",
|
1049
|
-
HTMLTag::BR => "br",
|
1050
|
-
HTMLTag::WBR => "wbr",
|
1051
|
-
HTMLTag::INS => "ins",
|
1052
|
-
HTMLTag::DEL => "del",
|
1053
|
-
HTMLTag::IMAGE => "image",
|
1054
|
-
HTMLTag::IMG => "img",
|
1055
|
-
HTMLTag::IFRAME => "iframe",
|
1056
|
-
HTMLTag::EMBED => "embed",
|
1057
|
-
HTMLTag::OBJECT => "object",
|
1058
|
-
HTMLTag::PARAM => "param",
|
1059
|
-
HTMLTag::VIDEO => "video",
|
1060
|
-
HTMLTag::AUDIO => "audio",
|
1061
|
-
HTMLTag::SOURCE => "source",
|
1062
|
-
HTMLTag::TRACK => "track",
|
1063
|
-
HTMLTag::CANVAS => "canvas",
|
1064
|
-
HTMLTag::MAP => "map",
|
1065
|
-
HTMLTag::AREA => "area",
|
1066
|
-
HTMLTag::MATH => "math",
|
1067
|
-
HTMLTag::MI => "mi",
|
1068
|
-
HTMLTag::MO => "mo",
|
1069
|
-
HTMLTag::MN => "mn",
|
1070
|
-
HTMLTag::MS => "ms",
|
1071
|
-
HTMLTag::MTEXT => "mtext",
|
1072
|
-
HTMLTag::MGLYPH => "mglyph",
|
1073
|
-
HTMLTag::MALIGNMARK => "malignmark",
|
1074
|
-
HTMLTag::ANNOTATION => "annotation",
|
1075
|
-
HTMLTag::SVG => "svg",
|
1076
|
-
HTMLTag::FOREIGNOBJECT => "foreignobject",
|
1077
|
-
HTMLTag::DESC => "desc",
|
1078
|
-
HTMLTag::TABLE => "table",
|
1079
|
-
HTMLTag::CAPTION => "caption",
|
1080
|
-
HTMLTag::COLGROUP => "colgroup",
|
1081
|
-
HTMLTag::COL => "col",
|
1082
|
-
HTMLTag::TBODY => "tbody",
|
1083
|
-
HTMLTag::THEAD => "thead",
|
1084
|
-
HTMLTag::TFOOT => "tfoot",
|
1085
|
-
HTMLTag::TR => "tr",
|
1086
|
-
HTMLTag::TD => "td",
|
1087
|
-
HTMLTag::TH => "th",
|
1088
|
-
HTMLTag::FORM => "form",
|
1089
|
-
HTMLTag::FIELDSET => "fieldset",
|
1090
|
-
HTMLTag::LEGEND => "legend",
|
1091
|
-
HTMLTag::LABEL => "label",
|
1092
|
-
HTMLTag::INPUT => "input",
|
1093
|
-
HTMLTag::BUTTON => "button",
|
1094
|
-
HTMLTag::SELECT => "select",
|
1095
|
-
HTMLTag::DATALIST => "datalist",
|
1096
|
-
HTMLTag::OPTGROUP => "optgroup",
|
1097
|
-
HTMLTag::OPTION => "option",
|
1098
|
-
HTMLTag::TEXTAREA => "textarea",
|
1099
|
-
HTMLTag::KEYGEN => "keygen",
|
1100
|
-
HTMLTag::OUTPUT => "output",
|
1101
|
-
HTMLTag::PROGRESS => "progress",
|
1102
|
-
HTMLTag::METER => "meter",
|
1103
|
-
HTMLTag::DETAILS => "details",
|
1104
|
-
HTMLTag::SUMMARY => "summary",
|
1105
|
-
HTMLTag::MENU => "menu",
|
1106
|
-
HTMLTag::MENUITEM => "menuitem",
|
1107
|
-
HTMLTag::APPLET => "applet",
|
1108
|
-
HTMLTag::ACRONYM => "acronym",
|
1109
|
-
HTMLTag::BGSOUND => "bgsound",
|
1110
|
-
HTMLTag::DIR => "dir",
|
1111
|
-
HTMLTag::FRAME => "frame",
|
1112
|
-
HTMLTag::FRAMESET => "frameset",
|
1113
|
-
HTMLTag::NOFRAMES => "noframes",
|
1114
|
-
HTMLTag::LISTING => "listing",
|
1115
|
-
HTMLTag::XMP => "xmp",
|
1116
|
-
HTMLTag::NEXTID => "nextid",
|
1117
|
-
HTMLTag::NOEMBED => "noembed",
|
1118
|
-
HTMLTag::PLAINTEXT => "plaintext",
|
1119
|
-
HTMLTag::RB => "rb",
|
1120
|
-
HTMLTag::STRIKE => "strike",
|
1121
|
-
HTMLTag::BASEFONT => "basefont",
|
1122
|
-
HTMLTag::BIG => "big",
|
1123
|
-
HTMLTag::BLINK => "blink",
|
1124
|
-
HTMLTag::CENTER => "center",
|
1125
|
-
HTMLTag::FONT => "font",
|
1126
|
-
HTMLTag::MARQUEE => "marquee",
|
1127
|
-
HTMLTag::MULTICOL => "multicol",
|
1128
|
-
HTMLTag::NOBR => "nobr",
|
1129
|
-
HTMLTag::SPACER => "spacer",
|
1130
|
-
HTMLTag::TT => "tt",
|
1131
|
-
HTMLTag::RTC => "rtc",
|
1132
|
-
HTMLTag::DIALOG => "dialog",
|
1133
|
-
_ => "unknown",
|
1134
|
-
}
|
1135
|
-
}
|
1136
|
-
}
|