nokogiri 1.10.10 → 1.12.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/LICENSE-DEPENDENCIES.md +1173 -884
  4. data/LICENSE.md +1 -1
  5. data/README.md +176 -96
  6. data/dependencies.yml +12 -12
  7. data/ext/nokogiri/depend +38 -358
  8. data/ext/nokogiri/extconf.rb +716 -414
  9. data/ext/nokogiri/gumbo.c +584 -0
  10. data/ext/nokogiri/html4_document.c +166 -0
  11. data/ext/nokogiri/html4_element_description.c +294 -0
  12. data/ext/nokogiri/html4_entity_lookup.c +37 -0
  13. data/ext/nokogiri/html4_sax_parser_context.c +120 -0
  14. data/ext/nokogiri/html4_sax_push_parser.c +95 -0
  15. data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
  16. data/ext/nokogiri/nokogiri.c +228 -91
  17. data/ext/nokogiri/nokogiri.h +191 -89
  18. data/ext/nokogiri/test_global_handlers.c +40 -0
  19. data/ext/nokogiri/xml_attr.c +15 -15
  20. data/ext/nokogiri/xml_attribute_decl.c +18 -18
  21. data/ext/nokogiri/xml_cdata.c +13 -18
  22. data/ext/nokogiri/xml_comment.c +19 -26
  23. data/ext/nokogiri/xml_document.c +267 -195
  24. data/ext/nokogiri/xml_document_fragment.c +13 -15
  25. data/ext/nokogiri/xml_dtd.c +54 -48
  26. data/ext/nokogiri/xml_element_content.c +31 -26
  27. data/ext/nokogiri/xml_element_decl.c +22 -22
  28. data/ext/nokogiri/xml_encoding_handler.c +28 -17
  29. data/ext/nokogiri/xml_entity_decl.c +32 -30
  30. data/ext/nokogiri/xml_entity_reference.c +16 -18
  31. data/ext/nokogiri/xml_namespace.c +60 -51
  32. data/ext/nokogiri/xml_node.c +493 -407
  33. data/ext/nokogiri/xml_node_set.c +174 -162
  34. data/ext/nokogiri/xml_processing_instruction.c +17 -19
  35. data/ext/nokogiri/xml_reader.c +197 -172
  36. data/ext/nokogiri/xml_relax_ng.c +52 -28
  37. data/ext/nokogiri/xml_sax_parser.c +112 -112
  38. data/ext/nokogiri/xml_sax_parser_context.c +105 -86
  39. data/ext/nokogiri/xml_sax_push_parser.c +36 -27
  40. data/ext/nokogiri/xml_schema.c +96 -46
  41. data/ext/nokogiri/xml_syntax_error.c +42 -21
  42. data/ext/nokogiri/xml_text.c +13 -17
  43. data/ext/nokogiri/xml_xpath_context.c +158 -73
  44. data/ext/nokogiri/xslt_stylesheet.c +158 -164
  45. data/gumbo-parser/CHANGES.md +63 -0
  46. data/gumbo-parser/Makefile +101 -0
  47. data/gumbo-parser/THANKS +27 -0
  48. data/gumbo-parser/src/Makefile +34 -0
  49. data/gumbo-parser/src/README.md +41 -0
  50. data/gumbo-parser/src/ascii.c +75 -0
  51. data/gumbo-parser/src/ascii.h +115 -0
  52. data/gumbo-parser/src/attribute.c +42 -0
  53. data/gumbo-parser/src/attribute.h +17 -0
  54. data/gumbo-parser/src/char_ref.c +22225 -0
  55. data/gumbo-parser/src/char_ref.h +29 -0
  56. data/gumbo-parser/src/char_ref.rl +2154 -0
  57. data/gumbo-parser/src/error.c +626 -0
  58. data/gumbo-parser/src/error.h +148 -0
  59. data/gumbo-parser/src/foreign_attrs.c +104 -0
  60. data/gumbo-parser/src/foreign_attrs.gperf +27 -0
  61. data/gumbo-parser/src/gumbo.h +943 -0
  62. data/gumbo-parser/src/insertion_mode.h +33 -0
  63. data/gumbo-parser/src/macros.h +91 -0
  64. data/gumbo-parser/src/parser.c +4886 -0
  65. data/gumbo-parser/src/parser.h +41 -0
  66. data/gumbo-parser/src/replacement.h +33 -0
  67. data/gumbo-parser/src/string_buffer.c +103 -0
  68. data/gumbo-parser/src/string_buffer.h +68 -0
  69. data/gumbo-parser/src/string_piece.c +48 -0
  70. data/gumbo-parser/src/svg_attrs.c +174 -0
  71. data/gumbo-parser/src/svg_attrs.gperf +77 -0
  72. data/gumbo-parser/src/svg_tags.c +137 -0
  73. data/gumbo-parser/src/svg_tags.gperf +55 -0
  74. data/gumbo-parser/src/tag.c +222 -0
  75. data/gumbo-parser/src/tag_lookup.c +382 -0
  76. data/gumbo-parser/src/tag_lookup.gperf +169 -0
  77. data/gumbo-parser/src/tag_lookup.h +13 -0
  78. data/gumbo-parser/src/token_buffer.c +79 -0
  79. data/gumbo-parser/src/token_buffer.h +71 -0
  80. data/gumbo-parser/src/token_type.h +17 -0
  81. data/gumbo-parser/src/tokenizer.c +3463 -0
  82. data/gumbo-parser/src/tokenizer.h +112 -0
  83. data/gumbo-parser/src/tokenizer_states.h +339 -0
  84. data/gumbo-parser/src/utf8.c +245 -0
  85. data/gumbo-parser/src/utf8.h +164 -0
  86. data/gumbo-parser/src/util.c +68 -0
  87. data/gumbo-parser/src/util.h +30 -0
  88. data/gumbo-parser/src/vector.c +111 -0
  89. data/gumbo-parser/src/vector.h +45 -0
  90. data/lib/nokogiri/css/node.rb +1 -0
  91. data/lib/nokogiri/css/parser.rb +64 -63
  92. data/lib/nokogiri/css/parser.y +3 -3
  93. data/lib/nokogiri/css/parser_extras.rb +39 -36
  94. data/lib/nokogiri/css/syntax_error.rb +2 -1
  95. data/lib/nokogiri/css/tokenizer.rb +1 -0
  96. data/lib/nokogiri/css/xpath_visitor.rb +73 -43
  97. data/lib/nokogiri/css.rb +15 -14
  98. data/lib/nokogiri/decorators/slop.rb +1 -0
  99. data/lib/nokogiri/extension.rb +31 -0
  100. data/lib/nokogiri/gumbo.rb +14 -0
  101. data/lib/nokogiri/html.rb +32 -27
  102. data/lib/nokogiri/{html → html4}/builder.rb +3 -2
  103. data/lib/nokogiri/{html → html4}/document.rb +17 -30
  104. data/lib/nokogiri/{html → html4}/document_fragment.rb +18 -17
  105. data/lib/nokogiri/{html → html4}/element_description.rb +2 -1
  106. data/lib/nokogiri/{html → html4}/element_description_defaults.rb +2 -1
  107. data/lib/nokogiri/{html → html4}/entity_lookup.rb +2 -1
  108. data/lib/nokogiri/{html → html4}/sax/parser.rb +12 -14
  109. data/lib/nokogiri/html4/sax/parser_context.rb +19 -0
  110. data/lib/nokogiri/{html → html4}/sax/push_parser.rb +6 -5
  111. data/lib/nokogiri/html4.rb +40 -0
  112. data/lib/nokogiri/html5/document.rb +74 -0
  113. data/lib/nokogiri/html5/document_fragment.rb +80 -0
  114. data/lib/nokogiri/html5/node.rb +93 -0
  115. data/lib/nokogiri/html5.rb +473 -0
  116. data/lib/nokogiri/jruby/dependencies.rb +20 -0
  117. data/lib/nokogiri/syntax_error.rb +1 -0
  118. data/lib/nokogiri/version/constant.rb +5 -0
  119. data/lib/nokogiri/version/info.rb +215 -0
  120. data/lib/nokogiri/version.rb +3 -109
  121. data/lib/nokogiri/xml/attr.rb +1 -0
  122. data/lib/nokogiri/xml/attribute_decl.rb +1 -0
  123. data/lib/nokogiri/xml/builder.rb +41 -2
  124. data/lib/nokogiri/xml/cdata.rb +1 -0
  125. data/lib/nokogiri/xml/character_data.rb +1 -0
  126. data/lib/nokogiri/xml/document.rb +138 -41
  127. data/lib/nokogiri/xml/document_fragment.rb +5 -6
  128. data/lib/nokogiri/xml/dtd.rb +1 -0
  129. data/lib/nokogiri/xml/element_content.rb +1 -0
  130. data/lib/nokogiri/xml/element_decl.rb +1 -0
  131. data/lib/nokogiri/xml/entity_decl.rb +1 -0
  132. data/lib/nokogiri/xml/entity_reference.rb +1 -0
  133. data/lib/nokogiri/xml/namespace.rb +1 -0
  134. data/lib/nokogiri/xml/node/save_options.rb +2 -1
  135. data/lib/nokogiri/xml/node.rb +629 -293
  136. data/lib/nokogiri/xml/node_set.rb +1 -0
  137. data/lib/nokogiri/xml/notation.rb +1 -0
  138. data/lib/nokogiri/xml/parse_options.rb +12 -3
  139. data/lib/nokogiri/xml/pp/character_data.rb +1 -0
  140. data/lib/nokogiri/xml/pp/node.rb +1 -0
  141. data/lib/nokogiri/xml/pp.rb +3 -2
  142. data/lib/nokogiri/xml/processing_instruction.rb +1 -0
  143. data/lib/nokogiri/xml/reader.rb +9 -12
  144. data/lib/nokogiri/xml/relax_ng.rb +7 -2
  145. data/lib/nokogiri/xml/sax/document.rb +25 -30
  146. data/lib/nokogiri/xml/sax/parser.rb +1 -0
  147. data/lib/nokogiri/xml/sax/parser_context.rb +1 -0
  148. data/lib/nokogiri/xml/sax/push_parser.rb +1 -0
  149. data/lib/nokogiri/xml/sax.rb +5 -4
  150. data/lib/nokogiri/xml/schema.rb +13 -4
  151. data/lib/nokogiri/xml/searchable.rb +25 -16
  152. data/lib/nokogiri/xml/syntax_error.rb +1 -0
  153. data/lib/nokogiri/xml/text.rb +1 -0
  154. data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
  155. data/lib/nokogiri/xml/xpath.rb +4 -5
  156. data/lib/nokogiri/xml/xpath_context.rb +1 -0
  157. data/lib/nokogiri/xml.rb +36 -36
  158. data/lib/nokogiri/xslt/stylesheet.rb +2 -1
  159. data/lib/nokogiri/xslt.rb +17 -16
  160. data/lib/nokogiri.rb +32 -51
  161. data/lib/xsd/xmlparser/nokogiri.rb +1 -0
  162. data/patches/libxml2/{0002-Remove-script-macro-support.patch → 0001-Remove-script-macro-support.patch} +0 -0
  163. data/patches/libxml2/{0003-Update-entities-to-remove-handling-of-ssi.patch → 0002-Update-entities-to-remove-handling-of-ssi.patch} +0 -0
  164. data/patches/libxml2/{0004-libxml2.la-is-in-top_builddir.patch → 0003-libxml2.la-is-in-top_builddir.patch} +1 -1
  165. data/patches/libxml2/0004-use-glibc-strlen.patch +53 -0
  166. data/patches/libxml2/0005-avoid-isnan-isinf.patch +81 -0
  167. data/patches/libxml2/0006-update-automake-files-for-arm64.patch +2511 -0
  168. data/patches/libxml2/0007-Fix-XPath-recursion-limit.patch +31 -0
  169. data/patches/libxslt/0001-update-automake-files-for-arm64.patch +2511 -0
  170. data/patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch +19 -0
  171. data/ports/archives/libxml2-2.9.12.tar.gz +0 -0
  172. metadata +139 -161
  173. data/ext/nokogiri/html_document.c +0 -170
  174. data/ext/nokogiri/html_document.h +0 -10
  175. data/ext/nokogiri/html_element_description.c +0 -279
  176. data/ext/nokogiri/html_element_description.h +0 -10
  177. data/ext/nokogiri/html_entity_lookup.c +0 -32
  178. data/ext/nokogiri/html_entity_lookup.h +0 -8
  179. data/ext/nokogiri/html_sax_parser_context.c +0 -116
  180. data/ext/nokogiri/html_sax_parser_context.h +0 -11
  181. data/ext/nokogiri/html_sax_push_parser.c +0 -87
  182. data/ext/nokogiri/html_sax_push_parser.h +0 -9
  183. data/ext/nokogiri/xml_attr.h +0 -9
  184. data/ext/nokogiri/xml_attribute_decl.h +0 -9
  185. data/ext/nokogiri/xml_cdata.h +0 -9
  186. data/ext/nokogiri/xml_comment.h +0 -9
  187. data/ext/nokogiri/xml_document.h +0 -23
  188. data/ext/nokogiri/xml_document_fragment.h +0 -10
  189. data/ext/nokogiri/xml_dtd.h +0 -10
  190. data/ext/nokogiri/xml_element_content.h +0 -10
  191. data/ext/nokogiri/xml_element_decl.h +0 -9
  192. data/ext/nokogiri/xml_encoding_handler.h +0 -8
  193. data/ext/nokogiri/xml_entity_decl.h +0 -10
  194. data/ext/nokogiri/xml_entity_reference.h +0 -9
  195. data/ext/nokogiri/xml_io.c +0 -61
  196. data/ext/nokogiri/xml_io.h +0 -11
  197. data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
  198. data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
  199. data/ext/nokogiri/xml_namespace.h +0 -14
  200. data/ext/nokogiri/xml_node.h +0 -13
  201. data/ext/nokogiri/xml_node_set.h +0 -12
  202. data/ext/nokogiri/xml_processing_instruction.h +0 -9
  203. data/ext/nokogiri/xml_reader.h +0 -10
  204. data/ext/nokogiri/xml_relax_ng.h +0 -9
  205. data/ext/nokogiri/xml_sax_parser.h +0 -39
  206. data/ext/nokogiri/xml_sax_parser_context.h +0 -10
  207. data/ext/nokogiri/xml_sax_push_parser.h +0 -9
  208. data/ext/nokogiri/xml_schema.h +0 -9
  209. data/ext/nokogiri/xml_syntax_error.h +0 -13
  210. data/ext/nokogiri/xml_text.h +0 -9
  211. data/ext/nokogiri/xml_xpath_context.h +0 -10
  212. data/ext/nokogiri/xslt_stylesheet.h +0 -14
  213. data/lib/nokogiri/html/sax/parser_context.rb +0 -16
  214. data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +0 -78
  215. data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0 -32
  216. data/ports/archives/libxml2-2.9.10.tar.gz +0 -0
@@ -0,0 +1,55 @@
1
+ %{
2
+ #include "replacement.h"
3
+ #include "macros.h"
4
+ #include "ascii.h"
5
+ %}
6
+
7
+ %ignore-case
8
+ %struct-type
9
+ %omit-struct-type
10
+ %compare-lengths
11
+ %readonly-tables
12
+ %null-strings
13
+ %includes
14
+ %define lookup-function-name gumbo_get_svg_tag_replacement
15
+ %define slot-name from
16
+ %define initializer-suffix ,(char*)0
17
+ StringReplacement;
18
+
19
+ %%
20
+ "altglyph", "altGlyph"
21
+ "altglyphdef", "altGlyphDef"
22
+ "altglyphitem", "altGlyphItem"
23
+ "animatecolor", "animateColor"
24
+ "animatemotion", "animateMotion"
25
+ "animatetransform", "animateTransform"
26
+ "clippath", "clipPath"
27
+ "feblend", "feBlend"
28
+ "fecolormatrix", "feColorMatrix"
29
+ "fecomponenttransfer", "feComponentTransfer"
30
+ "fecomposite", "feComposite"
31
+ "feconvolvematrix", "feConvolveMatrix"
32
+ "fediffuselighting", "feDiffuseLighting"
33
+ "fedisplacementmap", "feDisplacementMap"
34
+ "fedistantlight", "feDistantLight"
35
+ "feflood", "feFlood"
36
+ "fefunca", "feFuncA"
37
+ "fefuncb", "feFuncB"
38
+ "fefuncg", "feFuncG"
39
+ "fefuncr", "feFuncR"
40
+ "fegaussianblur", "feGaussianBlur"
41
+ "feimage", "feImage"
42
+ "femerge", "feMerge"
43
+ "femergenode", "feMergeNode"
44
+ "femorphology", "feMorphology"
45
+ "feoffset", "feOffset"
46
+ "fepointlight", "fePointLight"
47
+ "fespecularlighting", "feSpecularLighting"
48
+ "fespotlight", "feSpotLight"
49
+ "fetile", "feTile"
50
+ "feturbulence", "feTurbulence"
51
+ "foreignobject", "foreignObject"
52
+ "glyphref", "glyphRef"
53
+ "lineargradient", "linearGradient"
54
+ "radialgradient", "radialGradient"
55
+ "textpath", "textPath"
@@ -0,0 +1,222 @@
1
+ /*
2
+ Copyright 2011 Google Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ https://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ #include "gumbo.h"
18
+ #include "util.h"
19
+ #include "tag_lookup.h"
20
+
21
+ #include <assert.h>
22
+ #include <string.h>
23
+
24
+ static const char kGumboTagNames[GUMBO_TAG_LAST+1][15] = {
25
+ [GUMBO_TAG_HTML] = "html",
26
+ [GUMBO_TAG_HEAD] = "head",
27
+ [GUMBO_TAG_TITLE] = "title",
28
+ [GUMBO_TAG_BASE] = "base",
29
+ [GUMBO_TAG_LINK] = "link",
30
+ [GUMBO_TAG_META] = "meta",
31
+ [GUMBO_TAG_STYLE] = "style",
32
+ [GUMBO_TAG_SCRIPT] = "script",
33
+ [GUMBO_TAG_NOSCRIPT] = "noscript",
34
+ [GUMBO_TAG_TEMPLATE] = "template",
35
+ [GUMBO_TAG_BODY] = "body",
36
+ [GUMBO_TAG_ARTICLE] = "article",
37
+ [GUMBO_TAG_SECTION] = "section",
38
+ [GUMBO_TAG_NAV] = "nav",
39
+ [GUMBO_TAG_ASIDE] = "aside",
40
+ [GUMBO_TAG_H1] = "h1",
41
+ [GUMBO_TAG_H2] = "h2",
42
+ [GUMBO_TAG_H3] = "h3",
43
+ [GUMBO_TAG_H4] = "h4",
44
+ [GUMBO_TAG_H5] = "h5",
45
+ [GUMBO_TAG_H6] = "h6",
46
+ [GUMBO_TAG_HGROUP] = "hgroup",
47
+ [GUMBO_TAG_HEADER] = "header",
48
+ [GUMBO_TAG_FOOTER] = "footer",
49
+ [GUMBO_TAG_ADDRESS] = "address",
50
+ [GUMBO_TAG_P] = "p",
51
+ [GUMBO_TAG_HR] = "hr",
52
+ [GUMBO_TAG_PRE] = "pre",
53
+ [GUMBO_TAG_BLOCKQUOTE] = "blockquote",
54
+ [GUMBO_TAG_OL] = "ol",
55
+ [GUMBO_TAG_UL] = "ul",
56
+ [GUMBO_TAG_LI] = "li",
57
+ [GUMBO_TAG_DL] = "dl",
58
+ [GUMBO_TAG_DT] = "dt",
59
+ [GUMBO_TAG_DD] = "dd",
60
+ [GUMBO_TAG_FIGURE] = "figure",
61
+ [GUMBO_TAG_FIGCAPTION] = "figcaption",
62
+ [GUMBO_TAG_MAIN] = "main",
63
+ [GUMBO_TAG_DIV] = "div",
64
+ [GUMBO_TAG_A] = "a",
65
+ [GUMBO_TAG_EM] = "em",
66
+ [GUMBO_TAG_STRONG] = "strong",
67
+ [GUMBO_TAG_SMALL] = "small",
68
+ [GUMBO_TAG_S] = "s",
69
+ [GUMBO_TAG_CITE] = "cite",
70
+ [GUMBO_TAG_Q] = "q",
71
+ [GUMBO_TAG_DFN] = "dfn",
72
+ [GUMBO_TAG_ABBR] = "abbr",
73
+ [GUMBO_TAG_DATA] = "data",
74
+ [GUMBO_TAG_TIME] = "time",
75
+ [GUMBO_TAG_CODE] = "code",
76
+ [GUMBO_TAG_VAR] = "var",
77
+ [GUMBO_TAG_SAMP] = "samp",
78
+ [GUMBO_TAG_KBD] = "kbd",
79
+ [GUMBO_TAG_SUB] = "sub",
80
+ [GUMBO_TAG_SUP] = "sup",
81
+ [GUMBO_TAG_I] = "i",
82
+ [GUMBO_TAG_B] = "b",
83
+ [GUMBO_TAG_U] = "u",
84
+ [GUMBO_TAG_MARK] = "mark",
85
+ [GUMBO_TAG_RUBY] = "ruby",
86
+ [GUMBO_TAG_RT] = "rt",
87
+ [GUMBO_TAG_RP] = "rp",
88
+ [GUMBO_TAG_BDI] = "bdi",
89
+ [GUMBO_TAG_BDO] = "bdo",
90
+ [GUMBO_TAG_SPAN] = "span",
91
+ [GUMBO_TAG_BR] = "br",
92
+ [GUMBO_TAG_WBR] = "wbr",
93
+ [GUMBO_TAG_INS] = "ins",
94
+ [GUMBO_TAG_DEL] = "del",
95
+ [GUMBO_TAG_IMAGE] = "image",
96
+ [GUMBO_TAG_IMG] = "img",
97
+ [GUMBO_TAG_IFRAME] = "iframe",
98
+ [GUMBO_TAG_EMBED] = "embed",
99
+ [GUMBO_TAG_OBJECT] = "object",
100
+ [GUMBO_TAG_PARAM] = "param",
101
+ [GUMBO_TAG_VIDEO] = "video",
102
+ [GUMBO_TAG_AUDIO] = "audio",
103
+ [GUMBO_TAG_SOURCE] = "source",
104
+ [GUMBO_TAG_TRACK] = "track",
105
+ [GUMBO_TAG_CANVAS] = "canvas",
106
+ [GUMBO_TAG_MAP] = "map",
107
+ [GUMBO_TAG_AREA] = "area",
108
+ [GUMBO_TAG_MATH] = "math",
109
+ [GUMBO_TAG_MI] = "mi",
110
+ [GUMBO_TAG_MO] = "mo",
111
+ [GUMBO_TAG_MN] = "mn",
112
+ [GUMBO_TAG_MS] = "ms",
113
+ [GUMBO_TAG_MTEXT] = "mtext",
114
+ [GUMBO_TAG_MGLYPH] = "mglyph",
115
+ [GUMBO_TAG_MALIGNMARK] = "malignmark",
116
+ [GUMBO_TAG_ANNOTATION_XML] = "annotation-xml",
117
+ [GUMBO_TAG_SVG] = "svg",
118
+ [GUMBO_TAG_FOREIGNOBJECT] = "foreignobject",
119
+ [GUMBO_TAG_DESC] = "desc",
120
+ [GUMBO_TAG_TABLE] = "table",
121
+ [GUMBO_TAG_CAPTION] = "caption",
122
+ [GUMBO_TAG_COLGROUP] = "colgroup",
123
+ [GUMBO_TAG_COL] = "col",
124
+ [GUMBO_TAG_TBODY] = "tbody",
125
+ [GUMBO_TAG_THEAD] = "thead",
126
+ [GUMBO_TAG_TFOOT] = "tfoot",
127
+ [GUMBO_TAG_TR] = "tr",
128
+ [GUMBO_TAG_TD] = "td",
129
+ [GUMBO_TAG_TH] = "th",
130
+ [GUMBO_TAG_FORM] = "form",
131
+ [GUMBO_TAG_FIELDSET] = "fieldset",
132
+ [GUMBO_TAG_LEGEND] = "legend",
133
+ [GUMBO_TAG_LABEL] = "label",
134
+ [GUMBO_TAG_INPUT] = "input",
135
+ [GUMBO_TAG_BUTTON] = "button",
136
+ [GUMBO_TAG_SELECT] = "select",
137
+ [GUMBO_TAG_DATALIST] = "datalist",
138
+ [GUMBO_TAG_OPTGROUP] = "optgroup",
139
+ [GUMBO_TAG_OPTION] = "option",
140
+ [GUMBO_TAG_TEXTAREA] = "textarea",
141
+ [GUMBO_TAG_KEYGEN] = "keygen",
142
+ [GUMBO_TAG_OUTPUT] = "output",
143
+ [GUMBO_TAG_PROGRESS] = "progress",
144
+ [GUMBO_TAG_METER] = "meter",
145
+ [GUMBO_TAG_DETAILS] = "details",
146
+ [GUMBO_TAG_SUMMARY] = "summary",
147
+ [GUMBO_TAG_MENU] = "menu",
148
+ [GUMBO_TAG_MENUITEM] = "menuitem",
149
+ [GUMBO_TAG_APPLET] = "applet",
150
+ [GUMBO_TAG_ACRONYM] = "acronym",
151
+ [GUMBO_TAG_BGSOUND] = "bgsound",
152
+ [GUMBO_TAG_DIR] = "dir",
153
+ [GUMBO_TAG_FRAME] = "frame",
154
+ [GUMBO_TAG_FRAMESET] = "frameset",
155
+ [GUMBO_TAG_NOFRAMES] = "noframes",
156
+ [GUMBO_TAG_LISTING] = "listing",
157
+ [GUMBO_TAG_XMP] = "xmp",
158
+ [GUMBO_TAG_NEXTID] = "nextid",
159
+ [GUMBO_TAG_NOEMBED] = "noembed",
160
+ [GUMBO_TAG_PLAINTEXT] = "plaintext",
161
+ [GUMBO_TAG_RB] = "rb",
162
+ [GUMBO_TAG_STRIKE] = "strike",
163
+ [GUMBO_TAG_BASEFONT] = "basefont",
164
+ [GUMBO_TAG_BIG] = "big",
165
+ [GUMBO_TAG_BLINK] = "blink",
166
+ [GUMBO_TAG_CENTER] = "center",
167
+ [GUMBO_TAG_FONT] = "font",
168
+ [GUMBO_TAG_MARQUEE] = "marquee",
169
+ [GUMBO_TAG_MULTICOL] = "multicol",
170
+ [GUMBO_TAG_NOBR] = "nobr",
171
+ [GUMBO_TAG_SPACER] = "spacer",
172
+ [GUMBO_TAG_TT] = "tt",
173
+ [GUMBO_TAG_RTC] = "rtc",
174
+ [GUMBO_TAG_DIALOG] = "dialog",
175
+
176
+ [GUMBO_TAG_UNKNOWN] = "",
177
+ [GUMBO_TAG_LAST] = "",
178
+ };
179
+
180
+ const char* gumbo_normalized_tagname(GumboTag tag) {
181
+ assert(tag <= GUMBO_TAG_LAST);
182
+ const char *tagname = kGumboTagNames[tag];
183
+ assert(tagname);
184
+ return tagname;
185
+ }
186
+
187
+ void gumbo_tag_from_original_text(GumboStringPiece* text) {
188
+ if (text->data == NULL) {
189
+ return;
190
+ }
191
+
192
+ assert(text->length >= 2);
193
+ assert(text->data[0] == '<');
194
+ assert(text->data[text->length - 1] == '>');
195
+
196
+ if (text->data[1] == '/') {
197
+ // End tag
198
+ assert(text->length >= 3);
199
+ text->data += 2; // Move past </
200
+ text->length -= 3;
201
+ } else {
202
+ // Start tag
203
+ text->data += 1; // Move past <
204
+ text->length -= 2;
205
+ for (const char* c = text->data; c != text->data + text->length; ++c) {
206
+ switch (*c) {
207
+ case '\t':
208
+ case '\n':
209
+ case '\f':
210
+ case ' ':
211
+ case '/':
212
+ text->length = c - text->data;
213
+ return;
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ GumboTag gumbo_tagn_enum(const char *tagname, size_t tagname_length) {
220
+ const TagHashSlot *slot = gumbo_tag_lookup(tagname, tagname_length);
221
+ return slot ? slot->tag : GUMBO_TAG_UNKNOWN;
222
+ }
@@ -0,0 +1,382 @@
1
+ /* ANSI-C code produced by gperf version 3.1 */
2
+ /* Command-line: gperf -m100 lib/tag_lookup.gperf */
3
+ /* Computed positions: -k'1-2,$' */
4
+ /* Filtered by: mk/gperf-filter.sed */
5
+
6
+ #include "tag_lookup.h"
7
+ #include "macros.h"
8
+ #include "ascii.h"
9
+ #include <string.h>
10
+
11
+ #define TOTAL_KEYWORDS 150
12
+ #define MIN_WORD_LENGTH 1
13
+ #define MAX_WORD_LENGTH 14
14
+ #define MIN_HASH_VALUE 9
15
+ #define MAX_HASH_VALUE 271
16
+ /* maximum key range = 263, duplicates = 0 */
17
+
18
+
19
+
20
+ static inline unsigned int
21
+ hash (register const char *str, register size_t len)
22
+ {
23
+ static const unsigned short asso_values[] =
24
+ {
25
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
26
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
27
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
28
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
29
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 9,
30
+ 7, 6, 4, 4, 3, 4, 3, 3, 272, 272,
31
+ 272, 272, 272, 272, 272, 70, 83, 152, 7, 16,
32
+ 61, 98, 5, 76, 102, 126, 12, 19, 54, 54,
33
+ 31, 97, 3, 4, 9, 33, 136, 113, 86, 15,
34
+ 272, 272, 272, 272, 272, 272, 272, 70, 83, 152,
35
+ 7, 16, 61, 98, 5, 76, 102, 126, 12, 19,
36
+ 54, 54, 31, 97, 3, 4, 9, 33, 136, 113,
37
+ 86, 15, 272, 272, 272, 272, 272, 272, 272, 272,
38
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
39
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
40
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
41
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
42
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
43
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
44
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
45
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
46
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
47
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
48
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
49
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
50
+ 272, 272, 272, 272, 272, 272, 272, 272, 272
51
+ };
52
+ register unsigned int hval = len;
53
+
54
+ switch (hval)
55
+ {
56
+ default:
57
+ hval += asso_values[(unsigned char)str[1]+3];
58
+ /*FALLTHROUGH*/
59
+ case 1:
60
+ hval += asso_values[(unsigned char)str[0]];
61
+ break;
62
+ }
63
+ return hval + asso_values[(unsigned char)str[len - 1]];
64
+ }
65
+
66
+ const TagHashSlot *
67
+ gumbo_tag_lookup (register const char *str, register size_t len)
68
+ {
69
+ static const unsigned char lengthtable[] =
70
+ {
71
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2,
72
+ 2, 2, 2, 6, 2, 6, 2, 4, 0, 7, 6, 3, 0, 3,
73
+ 0, 6, 6, 8, 5, 0, 0, 4, 5, 5, 8, 0, 2, 4,
74
+ 5, 2, 0, 5, 4, 2, 0, 7, 0, 8, 5, 0, 0, 0,
75
+ 0, 0, 0, 5, 3, 4, 5, 1, 4, 0, 4, 1, 2, 8,
76
+ 7, 7, 6, 6, 8, 2, 8, 4, 2, 0, 6, 0, 0, 3,
77
+ 4, 6, 13, 4, 4, 6, 8, 0, 8, 4, 0, 6, 0, 8,
78
+ 4, 5, 0, 2, 2, 9, 2, 4, 0, 8, 4, 2, 4, 8,
79
+ 7, 0, 2, 5, 2, 0, 6, 0, 3, 2, 2, 6, 3, 8,
80
+ 7, 2, 5, 7, 0, 2, 6, 2, 4, 3, 0, 10, 5, 6,
81
+ 3, 1, 2, 0, 6, 0, 5, 5, 0, 3, 0, 3, 3, 1,
82
+ 4, 6, 4, 7, 3, 0, 0, 2, 10, 10, 0, 0, 6, 1,
83
+ 4, 6, 3, 0, 2, 5, 6, 4, 3, 4, 0, 7, 3, 0,
84
+ 0, 0, 4, 0, 0, 5, 0, 0, 0, 6, 0, 14, 8, 1,
85
+ 3, 0, 0, 7, 3, 0, 0, 0, 0, 0, 0, 5, 3, 0,
86
+ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 7, 6, 0, 0,
87
+ 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0,
88
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89
+ 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
90
+ 0, 0, 5, 0, 0, 3
91
+ };
92
+ static const TagHashSlot wordlist[] =
93
+ {
94
+ {(char*)0,GUMBO_TAG_UNKNOWN},
95
+ {(char*)0,GUMBO_TAG_UNKNOWN},
96
+ {(char*)0,GUMBO_TAG_UNKNOWN},
97
+ {(char*)0,GUMBO_TAG_UNKNOWN},
98
+ {(char*)0,GUMBO_TAG_UNKNOWN},
99
+ {(char*)0,GUMBO_TAG_UNKNOWN},
100
+ {(char*)0,GUMBO_TAG_UNKNOWN},
101
+ {(char*)0,GUMBO_TAG_UNKNOWN},
102
+ {(char*)0,GUMBO_TAG_UNKNOWN},
103
+ {"s", GUMBO_TAG_S},
104
+ {(char*)0,GUMBO_TAG_UNKNOWN},
105
+ {(char*)0,GUMBO_TAG_UNKNOWN},
106
+ {(char*)0,GUMBO_TAG_UNKNOWN},
107
+ {"h6", GUMBO_TAG_H6},
108
+ {"h5", GUMBO_TAG_H5},
109
+ {"h4", GUMBO_TAG_H4},
110
+ {"h3", GUMBO_TAG_H3},
111
+ {"spacer", GUMBO_TAG_SPACER},
112
+ {"h2", GUMBO_TAG_H2},
113
+ {"header", GUMBO_TAG_HEADER},
114
+ {"h1", GUMBO_TAG_H1},
115
+ {"head", GUMBO_TAG_HEAD},
116
+ {(char*)0,GUMBO_TAG_UNKNOWN},
117
+ {"details", GUMBO_TAG_DETAILS},
118
+ {"select", GUMBO_TAG_SELECT},
119
+ {"dir", GUMBO_TAG_DIR},
120
+ {(char*)0,GUMBO_TAG_UNKNOWN},
121
+ {"del", GUMBO_TAG_DEL},
122
+ {(char*)0,GUMBO_TAG_UNKNOWN},
123
+ {"source", GUMBO_TAG_SOURCE},
124
+ {"legend", GUMBO_TAG_LEGEND},
125
+ {"datalist", GUMBO_TAG_DATALIST},
126
+ {"meter", GUMBO_TAG_METER},
127
+ {(char*)0,GUMBO_TAG_UNKNOWN},
128
+ {(char*)0,GUMBO_TAG_UNKNOWN},
129
+ {"math", GUMBO_TAG_MATH},
130
+ {"label", GUMBO_TAG_LABEL},
131
+ {"table", GUMBO_TAG_TABLE},
132
+ {"template", GUMBO_TAG_TEMPLATE},
133
+ {(char*)0,GUMBO_TAG_UNKNOWN},
134
+ {"rp", GUMBO_TAG_RP},
135
+ {"time", GUMBO_TAG_TIME},
136
+ {"title", GUMBO_TAG_TITLE},
137
+ {"hr", GUMBO_TAG_HR},
138
+ {(char*)0,GUMBO_TAG_UNKNOWN},
139
+ {"tbody", GUMBO_TAG_TBODY},
140
+ {"samp", GUMBO_TAG_SAMP},
141
+ {"tr", GUMBO_TAG_TR},
142
+ {(char*)0,GUMBO_TAG_UNKNOWN},
143
+ {"marquee", GUMBO_TAG_MARQUEE},
144
+ {(char*)0,GUMBO_TAG_UNKNOWN},
145
+ {"menuitem", GUMBO_TAG_MENUITEM},
146
+ {"small", GUMBO_TAG_SMALL},
147
+ {(char*)0,GUMBO_TAG_UNKNOWN},
148
+ {(char*)0,GUMBO_TAG_UNKNOWN},
149
+ {(char*)0,GUMBO_TAG_UNKNOWN},
150
+ {(char*)0,GUMBO_TAG_UNKNOWN},
151
+ {(char*)0,GUMBO_TAG_UNKNOWN},
152
+ {(char*)0,GUMBO_TAG_UNKNOWN},
153
+ {"embed", GUMBO_TAG_EMBED},
154
+ {"map", GUMBO_TAG_MAP},
155
+ {"menu", GUMBO_TAG_MENU},
156
+ {"param", GUMBO_TAG_PARAM},
157
+ {"p", GUMBO_TAG_P},
158
+ {"nobr", GUMBO_TAG_NOBR},
159
+ {(char*)0,GUMBO_TAG_UNKNOWN},
160
+ {"span", GUMBO_TAG_SPAN},
161
+ {"u", GUMBO_TAG_U},
162
+ {"em", GUMBO_TAG_EM},
163
+ {"noframes", GUMBO_TAG_NOFRAMES},
164
+ {"section", GUMBO_TAG_SECTION},
165
+ {"noembed", GUMBO_TAG_NOEMBED},
166
+ {"nextid", GUMBO_TAG_NEXTID},
167
+ {"footer", GUMBO_TAG_FOOTER},
168
+ {"noscript", GUMBO_TAG_NOSCRIPT},
169
+ {"dl", GUMBO_TAG_DL},
170
+ {"progress", GUMBO_TAG_PROGRESS},
171
+ {"font", GUMBO_TAG_FONT},
172
+ {"mo", GUMBO_TAG_MO},
173
+ {(char*)0,GUMBO_TAG_UNKNOWN},
174
+ {"script", GUMBO_TAG_SCRIPT},
175
+ {(char*)0,GUMBO_TAG_UNKNOWN},
176
+ {(char*)0,GUMBO_TAG_UNKNOWN},
177
+ {"pre", GUMBO_TAG_PRE},
178
+ {"main", GUMBO_TAG_MAIN},
179
+ {"object", GUMBO_TAG_OBJECT},
180
+ {"foreignobject", GUMBO_TAG_FOREIGNOBJECT},
181
+ {"form", GUMBO_TAG_FORM},
182
+ {"data", GUMBO_TAG_DATA},
183
+ {"applet", GUMBO_TAG_APPLET},
184
+ {"fieldset", GUMBO_TAG_FIELDSET},
185
+ {(char*)0,GUMBO_TAG_UNKNOWN},
186
+ {"textarea", GUMBO_TAG_TEXTAREA},
187
+ {"abbr", GUMBO_TAG_ABBR},
188
+ {(char*)0,GUMBO_TAG_UNKNOWN},
189
+ {"figure", GUMBO_TAG_FIGURE},
190
+ {(char*)0,GUMBO_TAG_UNKNOWN},
191
+ {"optgroup", GUMBO_TAG_OPTGROUP},
192
+ {"meta", GUMBO_TAG_META},
193
+ {"tfoot", GUMBO_TAG_TFOOT},
194
+ {(char*)0,GUMBO_TAG_UNKNOWN},
195
+ {"ul", GUMBO_TAG_UL},
196
+ {"li", GUMBO_TAG_LI},
197
+ {"plaintext", GUMBO_TAG_PLAINTEXT},
198
+ {"rb", GUMBO_TAG_RB},
199
+ {"body", GUMBO_TAG_BODY},
200
+ {(char*)0,GUMBO_TAG_UNKNOWN},
201
+ {"basefont", GUMBO_TAG_BASEFONT},
202
+ {"ruby", GUMBO_TAG_RUBY},
203
+ {"mi", GUMBO_TAG_MI},
204
+ {"base", GUMBO_TAG_BASE},
205
+ {"frameset", GUMBO_TAG_FRAMESET},
206
+ {"summary", GUMBO_TAG_SUMMARY},
207
+ {(char*)0,GUMBO_TAG_UNKNOWN},
208
+ {"dd", GUMBO_TAG_DD},
209
+ {"frame", GUMBO_TAG_FRAME},
210
+ {"td", GUMBO_TAG_TD},
211
+ {(char*)0,GUMBO_TAG_UNKNOWN},
212
+ {"option", GUMBO_TAG_OPTION},
213
+ {(char*)0,GUMBO_TAG_UNKNOWN},
214
+ {"svg", GUMBO_TAG_SVG},
215
+ {"br", GUMBO_TAG_BR},
216
+ {"ol", GUMBO_TAG_OL},
217
+ {"dialog", GUMBO_TAG_DIALOG},
218
+ {"sup", GUMBO_TAG_SUP},
219
+ {"multicol", GUMBO_TAG_MULTICOL},
220
+ {"article", GUMBO_TAG_ARTICLE},
221
+ {"rt", GUMBO_TAG_RT},
222
+ {"image", GUMBO_TAG_IMAGE},
223
+ {"listing", GUMBO_TAG_LISTING},
224
+ {(char*)0,GUMBO_TAG_UNKNOWN},
225
+ {"dt", GUMBO_TAG_DT},
226
+ {"mglyph", GUMBO_TAG_MGLYPH},
227
+ {"tt", GUMBO_TAG_TT},
228
+ {"html", GUMBO_TAG_HTML},
229
+ {"wbr", GUMBO_TAG_WBR},
230
+ {(char*)0,GUMBO_TAG_UNKNOWN},
231
+ {"figcaption", GUMBO_TAG_FIGCAPTION},
232
+ {"style", GUMBO_TAG_STYLE},
233
+ {"strike", GUMBO_TAG_STRIKE},
234
+ {"dfn", GUMBO_TAG_DFN},
235
+ {"a", GUMBO_TAG_A},
236
+ {"th", GUMBO_TAG_TH},
237
+ {(char*)0,GUMBO_TAG_UNKNOWN},
238
+ {"hgroup", GUMBO_TAG_HGROUP},
239
+ {(char*)0,GUMBO_TAG_UNKNOWN},
240
+ {"mtext", GUMBO_TAG_MTEXT},
241
+ {"thead", GUMBO_TAG_THEAD},
242
+ {(char*)0,GUMBO_TAG_UNKNOWN},
243
+ {"var", GUMBO_TAG_VAR},
244
+ {(char*)0,GUMBO_TAG_UNKNOWN},
245
+ {"xmp", GUMBO_TAG_XMP},
246
+ {"kbd", GUMBO_TAG_KBD},
247
+ {"i", GUMBO_TAG_I},
248
+ {"link", GUMBO_TAG_LINK},
249
+ {"output", GUMBO_TAG_OUTPUT},
250
+ {"mark", GUMBO_TAG_MARK},
251
+ {"acronym", GUMBO_TAG_ACRONYM},
252
+ {"div", GUMBO_TAG_DIV},
253
+ {(char*)0,GUMBO_TAG_UNKNOWN},
254
+ {(char*)0,GUMBO_TAG_UNKNOWN},
255
+ {"ms", GUMBO_TAG_MS},
256
+ {"malignmark", GUMBO_TAG_MALIGNMARK},
257
+ {"blockquote", GUMBO_TAG_BLOCKQUOTE},
258
+ {(char*)0,GUMBO_TAG_UNKNOWN},
259
+ {(char*)0,GUMBO_TAG_UNKNOWN},
260
+ {"center", GUMBO_TAG_CENTER},
261
+ {"b", GUMBO_TAG_B},
262
+ {"desc", GUMBO_TAG_DESC},
263
+ {"canvas", GUMBO_TAG_CANVAS},
264
+ {"col", GUMBO_TAG_COL},
265
+ {(char*)0,GUMBO_TAG_UNKNOWN},
266
+ {"mn", GUMBO_TAG_MN},
267
+ {"track", GUMBO_TAG_TRACK},
268
+ {"iframe", GUMBO_TAG_IFRAME},
269
+ {"code", GUMBO_TAG_CODE},
270
+ {"sub", GUMBO_TAG_SUB},
271
+ {"area", GUMBO_TAG_AREA},
272
+ {(char*)0,GUMBO_TAG_UNKNOWN},
273
+ {"address", GUMBO_TAG_ADDRESS},
274
+ {"ins", GUMBO_TAG_INS},
275
+ {(char*)0,GUMBO_TAG_UNKNOWN},
276
+ {(char*)0,GUMBO_TAG_UNKNOWN},
277
+ {(char*)0,GUMBO_TAG_UNKNOWN},
278
+ {"cite", GUMBO_TAG_CITE},
279
+ {(char*)0,GUMBO_TAG_UNKNOWN},
280
+ {(char*)0,GUMBO_TAG_UNKNOWN},
281
+ {"input", GUMBO_TAG_INPUT},
282
+ {(char*)0,GUMBO_TAG_UNKNOWN},
283
+ {(char*)0,GUMBO_TAG_UNKNOWN},
284
+ {(char*)0,GUMBO_TAG_UNKNOWN},
285
+ {"keygen", GUMBO_TAG_KEYGEN},
286
+ {(char*)0,GUMBO_TAG_UNKNOWN},
287
+ {"annotation-xml", GUMBO_TAG_ANNOTATION_XML},
288
+ {"colgroup", GUMBO_TAG_COLGROUP},
289
+ {"q", GUMBO_TAG_Q},
290
+ {"big", GUMBO_TAG_BIG},
291
+ {(char*)0,GUMBO_TAG_UNKNOWN},
292
+ {(char*)0,GUMBO_TAG_UNKNOWN},
293
+ {"bgsound", GUMBO_TAG_BGSOUND},
294
+ {"nav", GUMBO_TAG_NAV},
295
+ {(char*)0,GUMBO_TAG_UNKNOWN},
296
+ {(char*)0,GUMBO_TAG_UNKNOWN},
297
+ {(char*)0,GUMBO_TAG_UNKNOWN},
298
+ {(char*)0,GUMBO_TAG_UNKNOWN},
299
+ {(char*)0,GUMBO_TAG_UNKNOWN},
300
+ {(char*)0,GUMBO_TAG_UNKNOWN},
301
+ {"video", GUMBO_TAG_VIDEO},
302
+ {"img", GUMBO_TAG_IMG},
303
+ {(char*)0,GUMBO_TAG_UNKNOWN},
304
+ {(char*)0,GUMBO_TAG_UNKNOWN},
305
+ {(char*)0,GUMBO_TAG_UNKNOWN},
306
+ {(char*)0,GUMBO_TAG_UNKNOWN},
307
+ {(char*)0,GUMBO_TAG_UNKNOWN},
308
+ {(char*)0,GUMBO_TAG_UNKNOWN},
309
+ {"audio", GUMBO_TAG_AUDIO},
310
+ {(char*)0,GUMBO_TAG_UNKNOWN},
311
+ {(char*)0,GUMBO_TAG_UNKNOWN},
312
+ {(char*)0,GUMBO_TAG_UNKNOWN},
313
+ {(char*)0,GUMBO_TAG_UNKNOWN},
314
+ {"caption", GUMBO_TAG_CAPTION},
315
+ {"strong", GUMBO_TAG_STRONG},
316
+ {(char*)0,GUMBO_TAG_UNKNOWN},
317
+ {(char*)0,GUMBO_TAG_UNKNOWN},
318
+ {(char*)0,GUMBO_TAG_UNKNOWN},
319
+ {(char*)0,GUMBO_TAG_UNKNOWN},
320
+ {(char*)0,GUMBO_TAG_UNKNOWN},
321
+ {"aside", GUMBO_TAG_ASIDE},
322
+ {(char*)0,GUMBO_TAG_UNKNOWN},
323
+ {"button", GUMBO_TAG_BUTTON},
324
+ {(char*)0,GUMBO_TAG_UNKNOWN},
325
+ {(char*)0,GUMBO_TAG_UNKNOWN},
326
+ {(char*)0,GUMBO_TAG_UNKNOWN},
327
+ {(char*)0,GUMBO_TAG_UNKNOWN},
328
+ {(char*)0,GUMBO_TAG_UNKNOWN},
329
+ {(char*)0,GUMBO_TAG_UNKNOWN},
330
+ {(char*)0,GUMBO_TAG_UNKNOWN},
331
+ {(char*)0,GUMBO_TAG_UNKNOWN},
332
+ {"bdo", GUMBO_TAG_BDO},
333
+ {(char*)0,GUMBO_TAG_UNKNOWN},
334
+ {(char*)0,GUMBO_TAG_UNKNOWN},
335
+ {(char*)0,GUMBO_TAG_UNKNOWN},
336
+ {(char*)0,GUMBO_TAG_UNKNOWN},
337
+ {(char*)0,GUMBO_TAG_UNKNOWN},
338
+ {(char*)0,GUMBO_TAG_UNKNOWN},
339
+ {(char*)0,GUMBO_TAG_UNKNOWN},
340
+ {(char*)0,GUMBO_TAG_UNKNOWN},
341
+ {(char*)0,GUMBO_TAG_UNKNOWN},
342
+ {(char*)0,GUMBO_TAG_UNKNOWN},
343
+ {(char*)0,GUMBO_TAG_UNKNOWN},
344
+ {(char*)0,GUMBO_TAG_UNKNOWN},
345
+ {(char*)0,GUMBO_TAG_UNKNOWN},
346
+ {(char*)0,GUMBO_TAG_UNKNOWN},
347
+ {(char*)0,GUMBO_TAG_UNKNOWN},
348
+ {(char*)0,GUMBO_TAG_UNKNOWN},
349
+ {(char*)0,GUMBO_TAG_UNKNOWN},
350
+ {(char*)0,GUMBO_TAG_UNKNOWN},
351
+ {(char*)0,GUMBO_TAG_UNKNOWN},
352
+ {(char*)0,GUMBO_TAG_UNKNOWN},
353
+ {(char*)0,GUMBO_TAG_UNKNOWN},
354
+ {"bdi", GUMBO_TAG_BDI},
355
+ {(char*)0,GUMBO_TAG_UNKNOWN},
356
+ {(char*)0,GUMBO_TAG_UNKNOWN},
357
+ {(char*)0,GUMBO_TAG_UNKNOWN},
358
+ {(char*)0,GUMBO_TAG_UNKNOWN},
359
+ {(char*)0,GUMBO_TAG_UNKNOWN},
360
+ {(char*)0,GUMBO_TAG_UNKNOWN},
361
+ {(char*)0,GUMBO_TAG_UNKNOWN},
362
+ {"blink", GUMBO_TAG_BLINK},
363
+ {(char*)0,GUMBO_TAG_UNKNOWN},
364
+ {(char*)0,GUMBO_TAG_UNKNOWN},
365
+ {"rtc", GUMBO_TAG_RTC}
366
+ };
367
+
368
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
369
+ {
370
+ register unsigned int key = hash (str, len);
371
+
372
+ if (key <= MAX_HASH_VALUE)
373
+ if (len == lengthtable[key])
374
+ {
375
+ register const char *s = wordlist[key].key;
376
+
377
+ if (s && (((unsigned char)*str ^ (unsigned char)*s) & ~32) == 0 && !gumbo_ascii_strncasecmp(str, s, len))
378
+ return &wordlist[key];
379
+ }
380
+ }
381
+ return 0;
382
+ }