fasthtmlparser 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,761 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Code generated by tools/gen.rb from HtmlTag.cs; DO NOT EDIT.
4
+
5
+ module FastHtmlParser
6
+ # Known tag names: HTML (incl. obsolete), SVG, MathML and common XML (RSS, Atom, sitemap), as symbols of the
7
+ # lower-case name (Tag::DIV is :div; :"!--" for comments, :"!doctype", :"?xml"). Any other name works as a
8
+ # Symbol or String in the methods that take a tag name.
9
+ module Tag
10
+ HTML = :html
11
+ HEAD = :head
12
+ TITLE = :title
13
+ BODY = :body
14
+ LINK = :link
15
+ META = :meta
16
+ STYLE = :style
17
+ SCRIPT = :script
18
+ NOSCRIPT = :noscript
19
+ SECTION = :section
20
+ NAV = :nav
21
+ ARTICLE = :article
22
+ ASIDE = :aside
23
+ H1 = :h1
24
+ H2 = :h2
25
+ H3 = :h3
26
+ H4 = :h4
27
+ H5 = :h5
28
+ H6 = :h6
29
+ HEADER = :header
30
+ FOOTER = :footer
31
+ MAIN = :main
32
+ ADDRESS = :address
33
+ P = :p
34
+ HR = :hr
35
+ PRE = :pre
36
+ BLOCKQUOTE = :blockquote
37
+ OL = :ol
38
+ UL = :ul
39
+ LI = :li
40
+ DL = :dl
41
+ DT = :dt
42
+ DD = :dd
43
+ FIGURE = :figure
44
+ FIGCAPTION = :figcaption
45
+ DIV = :div
46
+ A = :a
47
+ EM = :em
48
+ STRONG = :strong
49
+ SMALL = :small
50
+ S = :s
51
+ CITE = :cite
52
+ Q = :q
53
+ CODE = :code
54
+ SAMP = :samp
55
+ KBD = :kbd
56
+ SUB = :sub
57
+ SUP = :sup
58
+ I = :i
59
+ B = :b
60
+ U = :u
61
+ SPAN = :span
62
+ BR = :br
63
+ WBR = :wbr
64
+ IMG = :img
65
+ IFRAME = :iframe
66
+ EMBED = :embed
67
+ OBJECT = :object
68
+ PICTURE = :picture
69
+ SOURCE = :source
70
+ VIDEO = :video
71
+ AUDIO = :audio
72
+ TRACK = :track
73
+ CANVAS = :canvas
74
+ SVG = :svg
75
+ TABLE = :table
76
+ CAPTION = :caption
77
+ COLGROUP = :colgroup
78
+ COL = :col
79
+ TBODY = :tbody
80
+ THEAD = :thead
81
+ TFOOT = :tfoot
82
+ TR = :tr
83
+ TD = :td
84
+ TH = :th
85
+ FORM = :form
86
+ LABEL = :label
87
+ INPUT = :input
88
+ BUTTON = :button
89
+ SELECT = :select
90
+ DATALIST = :datalist
91
+ OPTGROUP = :optgroup
92
+ OPTION = :option
93
+ TEXTAREA = :textarea
94
+ OUTPUT = :output
95
+ PROGRESS = :progress
96
+ METER = :meter
97
+ FIELDSET = :fieldset
98
+ LEGEND = :legend
99
+ DETAILS = :details
100
+ SUMMARY = :summary
101
+ DIALOG = :dialog
102
+ BASE = :base
103
+ TEMPLATE = :template
104
+ SLOT = :slot
105
+ HGROUP = :hgroup
106
+ SEARCH = :search
107
+ MENU = :menu
108
+ ABBR = :abbr
109
+ BDI = :bdi
110
+ BDO = :bdo
111
+ DATA = :data
112
+ DFN = :dfn
113
+ INS = :ins
114
+ DEL = :del
115
+ MARK = :mark
116
+ RP = :rp
117
+ RT = :rt
118
+ RUBY = :ruby
119
+ TIME = :time
120
+ VAR = :var
121
+ MAP = :map
122
+ AREA = :area
123
+ PARAM = :param
124
+ ACRONYM = :acronym
125
+ APPLET = :applet
126
+ BASEFONT = :basefont
127
+ BGSOUND = :bgsound
128
+ BIG = :big
129
+ BLINK = :blink
130
+ CENTER = :center
131
+ DIR = :dir
132
+ FONT = :font
133
+ FRAME = :frame
134
+ FRAMESET = :frameset
135
+ ISINDEX = :isindex
136
+ KEYGEN = :keygen
137
+ LISTING = :listing
138
+ MARQUEE = :marquee
139
+ MENUITEM = :menuitem
140
+ MULTICOL = :multicol
141
+ NEXTID = :nextid
142
+ NOBR = :nobr
143
+ NOEMBED = :noembed
144
+ NOFRAMES = :noframes
145
+ PLAINTEXT = :plaintext
146
+ RB = :rb
147
+ RTC = :rtc
148
+ SPACER = :spacer
149
+ STRIKE = :strike
150
+ TT = :tt
151
+ XMP = :xmp
152
+ COMMENT = :"!--"
153
+ DOCTYPE = :"!doctype"
154
+ XML_DECLARATION = :"?xml"
155
+ ANIMATE = :animate
156
+ ANIMATE_MOTION = :animatemotion
157
+ ANIMATE_TRANSFORM = :animatetransform
158
+ CIRCLE = :circle
159
+ CLIP_PATH = :clippath
160
+ DEFS = :defs
161
+ DESC = :desc
162
+ ELLIPSE = :ellipse
163
+ FE_BLEND = :feblend
164
+ FE_COLOR_MATRIX = :fecolormatrix
165
+ FE_COMPOSITE = :fecomposite
166
+ FE_FLOOD = :feflood
167
+ FE_GAUSSIAN_BLUR = :fegaussianblur
168
+ FE_MERGE = :femerge
169
+ FE_MERGE_NODE = :femergenode
170
+ FE_OFFSET = :feoffset
171
+ FILTER = :filter
172
+ FOREIGN_OBJECT = :foreignobject
173
+ G = :g
174
+ IMAGE = :image
175
+ LINE = :line
176
+ LINEAR_GRADIENT = :lineargradient
177
+ MARKER = :marker
178
+ MASK = :mask
179
+ METADATA = :metadata
180
+ MPATH = :mpath
181
+ PATH = :path
182
+ PATTERN = :pattern
183
+ POLYGON = :polygon
184
+ POLYLINE = :polyline
185
+ RADIAL_GRADIENT = :radialgradient
186
+ RECT = :rect
187
+ SET = :set
188
+ STOP = :stop
189
+ SWITCH = :switch
190
+ SYMBOL = :symbol
191
+ TEXT = :text
192
+ TEXT_PATH = :textpath
193
+ TSPAN = :tspan
194
+ USE = :use
195
+ VIEW = :view
196
+ MATH = :math
197
+ ANNOTATION = :annotation
198
+ SEMANTICS = :semantics
199
+ MI = :mi
200
+ MN = :mn
201
+ MO = :mo
202
+ MS = :ms
203
+ MTEXT = :mtext
204
+ MROW = :mrow
205
+ MFRAC = :mfrac
206
+ MSQRT = :msqrt
207
+ MROOT = :mroot
208
+ MSUB = :msub
209
+ MSUP = :msup
210
+ MSUBSUP = :msubsup
211
+ MUNDER = :munder
212
+ MOVER = :mover
213
+ MUNDEROVER = :munderover
214
+ MTABLE = :mtable
215
+ MTR = :mtr
216
+ MTD = :mtd
217
+ MSPACE = :mspace
218
+ MSTYLE = :mstyle
219
+ MERROR = :merror
220
+ MPADDED = :mpadded
221
+ MPHANTOM = :mphantom
222
+ RSS = :rss
223
+ CHANNEL = :channel
224
+ ITEM = :item
225
+ GUID = :guid
226
+ PUB_DATE = :pubdate
227
+ LAST_BUILD_DATE = :lastbuilddate
228
+ CATEGORY = :category
229
+ ENCLOSURE = :enclosure
230
+ AUTHOR = :author
231
+ COMMENTS = :comments
232
+ LANGUAGE = :language
233
+ GENERATOR = :generator
234
+ DESCRIPTION = :description
235
+ COPYRIGHT = :copyright
236
+ TTL = :ttl
237
+ FEED = :feed
238
+ ENTRY = :entry
239
+ ID = :id
240
+ UPDATED = :updated
241
+ PUBLISHED = :published
242
+ CONTENT = :content
243
+ NAME = :name
244
+ URI = :uri
245
+ EMAIL = :email
246
+ SUBTITLE = :subtitle
247
+ RIGHTS = :rights
248
+ CONTRIBUTOR = :contributor
249
+ URLSET = :urlset
250
+ URL = :url
251
+ LOC = :loc
252
+ LASTMOD = :lastmod
253
+ CHANGEFREQ = :changefreq
254
+ PRIORITY = :priority
255
+ SITEMAPINDEX = :sitemapindex
256
+ SITEMAP = :sitemap
257
+ end
258
+
259
+ # @api private The tag names by ordinal (the order of the C# enum) and the ordinals by name.
260
+ module TagNames
261
+ NAMES = [
262
+ "html",
263
+ "head",
264
+ "title",
265
+ "body",
266
+ "link",
267
+ "meta",
268
+ "style",
269
+ "script",
270
+ "noscript",
271
+ "section",
272
+ "nav",
273
+ "article",
274
+ "aside",
275
+ "h1",
276
+ "h2",
277
+ "h3",
278
+ "h4",
279
+ "h5",
280
+ "h6",
281
+ "header",
282
+ "footer",
283
+ "main",
284
+ "address",
285
+ "p",
286
+ "hr",
287
+ "pre",
288
+ "blockquote",
289
+ "ol",
290
+ "ul",
291
+ "li",
292
+ "dl",
293
+ "dt",
294
+ "dd",
295
+ "figure",
296
+ "figcaption",
297
+ "div",
298
+ "a",
299
+ "em",
300
+ "strong",
301
+ "small",
302
+ "s",
303
+ "cite",
304
+ "q",
305
+ "code",
306
+ "samp",
307
+ "kbd",
308
+ "sub",
309
+ "sup",
310
+ "i",
311
+ "b",
312
+ "u",
313
+ "span",
314
+ "br",
315
+ "wbr",
316
+ "img",
317
+ "iframe",
318
+ "embed",
319
+ "object",
320
+ "picture",
321
+ "source",
322
+ "video",
323
+ "audio",
324
+ "track",
325
+ "canvas",
326
+ "svg",
327
+ "table",
328
+ "caption",
329
+ "colgroup",
330
+ "col",
331
+ "tbody",
332
+ "thead",
333
+ "tfoot",
334
+ "tr",
335
+ "td",
336
+ "th",
337
+ "form",
338
+ "label",
339
+ "input",
340
+ "button",
341
+ "select",
342
+ "datalist",
343
+ "optgroup",
344
+ "option",
345
+ "textarea",
346
+ "output",
347
+ "progress",
348
+ "meter",
349
+ "fieldset",
350
+ "legend",
351
+ "details",
352
+ "summary",
353
+ "dialog",
354
+ "base",
355
+ "template",
356
+ "slot",
357
+ "hgroup",
358
+ "search",
359
+ "menu",
360
+ "abbr",
361
+ "bdi",
362
+ "bdo",
363
+ "data",
364
+ "dfn",
365
+ "ins",
366
+ "del",
367
+ "mark",
368
+ "rp",
369
+ "rt",
370
+ "ruby",
371
+ "time",
372
+ "var",
373
+ "map",
374
+ "area",
375
+ "param",
376
+ "acronym",
377
+ "applet",
378
+ "basefont",
379
+ "bgsound",
380
+ "big",
381
+ "blink",
382
+ "center",
383
+ "dir",
384
+ "font",
385
+ "frame",
386
+ "frameset",
387
+ "isindex",
388
+ "keygen",
389
+ "listing",
390
+ "marquee",
391
+ "menuitem",
392
+ "multicol",
393
+ "nextid",
394
+ "nobr",
395
+ "noembed",
396
+ "noframes",
397
+ "plaintext",
398
+ "rb",
399
+ "rtc",
400
+ "spacer",
401
+ "strike",
402
+ "tt",
403
+ "xmp",
404
+ "!--",
405
+ "!doctype",
406
+ "?xml",
407
+ "animate",
408
+ "animatemotion",
409
+ "animatetransform",
410
+ "circle",
411
+ "clippath",
412
+ "defs",
413
+ "desc",
414
+ "ellipse",
415
+ "feblend",
416
+ "fecolormatrix",
417
+ "fecomposite",
418
+ "feflood",
419
+ "fegaussianblur",
420
+ "femerge",
421
+ "femergenode",
422
+ "feoffset",
423
+ "filter",
424
+ "foreignobject",
425
+ "g",
426
+ "image",
427
+ "line",
428
+ "lineargradient",
429
+ "marker",
430
+ "mask",
431
+ "metadata",
432
+ "mpath",
433
+ "path",
434
+ "pattern",
435
+ "polygon",
436
+ "polyline",
437
+ "radialgradient",
438
+ "rect",
439
+ "set",
440
+ "stop",
441
+ "switch",
442
+ "symbol",
443
+ "text",
444
+ "textpath",
445
+ "tspan",
446
+ "use",
447
+ "view",
448
+ "math",
449
+ "annotation",
450
+ "semantics",
451
+ "mi",
452
+ "mn",
453
+ "mo",
454
+ "ms",
455
+ "mtext",
456
+ "mrow",
457
+ "mfrac",
458
+ "msqrt",
459
+ "mroot",
460
+ "msub",
461
+ "msup",
462
+ "msubsup",
463
+ "munder",
464
+ "mover",
465
+ "munderover",
466
+ "mtable",
467
+ "mtr",
468
+ "mtd",
469
+ "mspace",
470
+ "mstyle",
471
+ "merror",
472
+ "mpadded",
473
+ "mphantom",
474
+ "rss",
475
+ "channel",
476
+ "item",
477
+ "guid",
478
+ "pubdate",
479
+ "lastbuilddate",
480
+ "category",
481
+ "enclosure",
482
+ "author",
483
+ "comments",
484
+ "language",
485
+ "generator",
486
+ "description",
487
+ "copyright",
488
+ "ttl",
489
+ "feed",
490
+ "entry",
491
+ "id",
492
+ "updated",
493
+ "published",
494
+ "content",
495
+ "name",
496
+ "uri",
497
+ "email",
498
+ "subtitle",
499
+ "rights",
500
+ "contributor",
501
+ "urlset",
502
+ "url",
503
+ "loc",
504
+ "lastmod",
505
+ "changefreq",
506
+ "priority",
507
+ "sitemapindex",
508
+ "sitemap",
509
+ ].freeze
510
+
511
+ KEYS = {
512
+ "html" => 0,
513
+ "head" => 1,
514
+ "title" => 2,
515
+ "body" => 3,
516
+ "link" => 4,
517
+ "meta" => 5,
518
+ "style" => 6,
519
+ "script" => 7,
520
+ "noscript" => 8,
521
+ "section" => 9,
522
+ "nav" => 10,
523
+ "article" => 11,
524
+ "aside" => 12,
525
+ "h1" => 13,
526
+ "h2" => 14,
527
+ "h3" => 15,
528
+ "h4" => 16,
529
+ "h5" => 17,
530
+ "h6" => 18,
531
+ "header" => 19,
532
+ "footer" => 20,
533
+ "main" => 21,
534
+ "address" => 22,
535
+ "p" => 23,
536
+ "hr" => 24,
537
+ "pre" => 25,
538
+ "blockquote" => 26,
539
+ "ol" => 27,
540
+ "ul" => 28,
541
+ "li" => 29,
542
+ "dl" => 30,
543
+ "dt" => 31,
544
+ "dd" => 32,
545
+ "figure" => 33,
546
+ "figcaption" => 34,
547
+ "div" => 35,
548
+ "a" => 36,
549
+ "em" => 37,
550
+ "strong" => 38,
551
+ "small" => 39,
552
+ "s" => 40,
553
+ "cite" => 41,
554
+ "q" => 42,
555
+ "code" => 43,
556
+ "samp" => 44,
557
+ "kbd" => 45,
558
+ "sub" => 46,
559
+ "sup" => 47,
560
+ "i" => 48,
561
+ "b" => 49,
562
+ "u" => 50,
563
+ "span" => 51,
564
+ "br" => 52,
565
+ "wbr" => 53,
566
+ "img" => 54,
567
+ "iframe" => 55,
568
+ "embed" => 56,
569
+ "object" => 57,
570
+ "picture" => 58,
571
+ "source" => 59,
572
+ "video" => 60,
573
+ "audio" => 61,
574
+ "track" => 62,
575
+ "canvas" => 63,
576
+ "svg" => 64,
577
+ "table" => 65,
578
+ "caption" => 66,
579
+ "colgroup" => 67,
580
+ "col" => 68,
581
+ "tbody" => 69,
582
+ "thead" => 70,
583
+ "tfoot" => 71,
584
+ "tr" => 72,
585
+ "td" => 73,
586
+ "th" => 74,
587
+ "form" => 75,
588
+ "label" => 76,
589
+ "input" => 77,
590
+ "button" => 78,
591
+ "select" => 79,
592
+ "datalist" => 80,
593
+ "optgroup" => 81,
594
+ "option" => 82,
595
+ "textarea" => 83,
596
+ "output" => 84,
597
+ "progress" => 85,
598
+ "meter" => 86,
599
+ "fieldset" => 87,
600
+ "legend" => 88,
601
+ "details" => 89,
602
+ "summary" => 90,
603
+ "dialog" => 91,
604
+ "base" => 92,
605
+ "template" => 93,
606
+ "slot" => 94,
607
+ "hgroup" => 95,
608
+ "search" => 96,
609
+ "menu" => 97,
610
+ "abbr" => 98,
611
+ "bdi" => 99,
612
+ "bdo" => 100,
613
+ "data" => 101,
614
+ "dfn" => 102,
615
+ "ins" => 103,
616
+ "del" => 104,
617
+ "mark" => 105,
618
+ "rp" => 106,
619
+ "rt" => 107,
620
+ "ruby" => 108,
621
+ "time" => 109,
622
+ "var" => 110,
623
+ "map" => 111,
624
+ "area" => 112,
625
+ "param" => 113,
626
+ "acronym" => 114,
627
+ "applet" => 115,
628
+ "basefont" => 116,
629
+ "bgsound" => 117,
630
+ "big" => 118,
631
+ "blink" => 119,
632
+ "center" => 120,
633
+ "dir" => 121,
634
+ "font" => 122,
635
+ "frame" => 123,
636
+ "frameset" => 124,
637
+ "isindex" => 125,
638
+ "keygen" => 126,
639
+ "listing" => 127,
640
+ "marquee" => 128,
641
+ "menuitem" => 129,
642
+ "multicol" => 130,
643
+ "nextid" => 131,
644
+ "nobr" => 132,
645
+ "noembed" => 133,
646
+ "noframes" => 134,
647
+ "plaintext" => 135,
648
+ "rb" => 136,
649
+ "rtc" => 137,
650
+ "spacer" => 138,
651
+ "strike" => 139,
652
+ "tt" => 140,
653
+ "xmp" => 141,
654
+ "!--" => 142,
655
+ "!doctype" => 143,
656
+ "?xml" => 144,
657
+ "animate" => 145,
658
+ "animatemotion" => 146,
659
+ "animatetransform" => 147,
660
+ "circle" => 148,
661
+ "clippath" => 149,
662
+ "defs" => 150,
663
+ "desc" => 151,
664
+ "ellipse" => 152,
665
+ "feblend" => 153,
666
+ "fecolormatrix" => 154,
667
+ "fecomposite" => 155,
668
+ "feflood" => 156,
669
+ "fegaussianblur" => 157,
670
+ "femerge" => 158,
671
+ "femergenode" => 159,
672
+ "feoffset" => 160,
673
+ "filter" => 161,
674
+ "foreignobject" => 162,
675
+ "g" => 163,
676
+ "image" => 164,
677
+ "line" => 165,
678
+ "lineargradient" => 166,
679
+ "marker" => 167,
680
+ "mask" => 168,
681
+ "metadata" => 169,
682
+ "mpath" => 170,
683
+ "path" => 171,
684
+ "pattern" => 172,
685
+ "polygon" => 173,
686
+ "polyline" => 174,
687
+ "radialgradient" => 175,
688
+ "rect" => 176,
689
+ "set" => 177,
690
+ "stop" => 178,
691
+ "switch" => 179,
692
+ "symbol" => 180,
693
+ "text" => 181,
694
+ "textpath" => 182,
695
+ "tspan" => 183,
696
+ "use" => 184,
697
+ "view" => 185,
698
+ "math" => 186,
699
+ "annotation" => 187,
700
+ "semantics" => 188,
701
+ "mi" => 189,
702
+ "mn" => 190,
703
+ "mo" => 191,
704
+ "ms" => 192,
705
+ "mtext" => 193,
706
+ "mrow" => 194,
707
+ "mfrac" => 195,
708
+ "msqrt" => 196,
709
+ "mroot" => 197,
710
+ "msub" => 198,
711
+ "msup" => 199,
712
+ "msubsup" => 200,
713
+ "munder" => 201,
714
+ "mover" => 202,
715
+ "munderover" => 203,
716
+ "mtable" => 204,
717
+ "mtr" => 205,
718
+ "mtd" => 206,
719
+ "mspace" => 207,
720
+ "mstyle" => 208,
721
+ "merror" => 209,
722
+ "mpadded" => 210,
723
+ "mphantom" => 211,
724
+ "rss" => 212,
725
+ "channel" => 213,
726
+ "item" => 214,
727
+ "guid" => 215,
728
+ "pubdate" => 216,
729
+ "lastbuilddate" => 217,
730
+ "category" => 218,
731
+ "enclosure" => 219,
732
+ "author" => 220,
733
+ "comments" => 221,
734
+ "language" => 222,
735
+ "generator" => 223,
736
+ "description" => 224,
737
+ "copyright" => 225,
738
+ "ttl" => 226,
739
+ "feed" => 227,
740
+ "entry" => 228,
741
+ "id" => 229,
742
+ "updated" => 230,
743
+ "published" => 231,
744
+ "content" => 232,
745
+ "name" => 233,
746
+ "uri" => 234,
747
+ "email" => 235,
748
+ "subtitle" => 236,
749
+ "rights" => 237,
750
+ "contributor" => 238,
751
+ "urlset" => 239,
752
+ "url" => 240,
753
+ "loc" => 241,
754
+ "lastmod" => 242,
755
+ "changefreq" => 243,
756
+ "priority" => 244,
757
+ "sitemapindex" => 245,
758
+ "sitemap" => 246,
759
+ }.freeze
760
+ end
761
+ end