gumbo-html 0.2.4 → 0.3.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.
Files changed (52) hide show
  1. package/README.md +27 -10
  2. package/binding.gyp +49 -0
  3. package/examples/example.js +87 -0
  4. package/examples/scrape.js +301 -0
  5. package/index.d.ts +58 -3
  6. package/index.js +7 -2
  7. package/lib/wrapper.js +385 -0
  8. package/package.json +36 -5
  9. package/src/addon.cc +19 -0
  10. package/src/gumbo-parser/COPYING +201 -0
  11. package/src/gumbo-parser/README.md +8 -0
  12. package/src/gumbo-parser/src/attribute.c +44 -0
  13. package/src/gumbo-parser/src/attribute.h +37 -0
  14. package/src/gumbo-parser/src/char_ref.c +23069 -0
  15. package/src/gumbo-parser/src/char_ref.h +60 -0
  16. package/src/gumbo-parser/src/error.c +279 -0
  17. package/src/gumbo-parser/src/error.h +225 -0
  18. package/src/gumbo-parser/src/gumbo.h +671 -0
  19. package/src/gumbo-parser/src/insertion_mode.h +57 -0
  20. package/src/gumbo-parser/src/parser.c +4192 -0
  21. package/src/gumbo-parser/src/parser.h +57 -0
  22. package/src/gumbo-parser/src/string_buffer.c +110 -0
  23. package/src/gumbo-parser/src/string_buffer.h +84 -0
  24. package/src/gumbo-parser/src/string_piece.c +48 -0
  25. package/src/gumbo-parser/src/string_piece.h +38 -0
  26. package/src/gumbo-parser/src/tag.c +95 -0
  27. package/src/gumbo-parser/src/tag_enum.h +153 -0
  28. package/src/gumbo-parser/src/tag_gperf.h +105 -0
  29. package/src/gumbo-parser/src/tag_sizes.h +4 -0
  30. package/src/gumbo-parser/src/tag_strings.h +153 -0
  31. package/src/gumbo-parser/src/token_type.h +41 -0
  32. package/src/gumbo-parser/src/tokenizer.c +2897 -0
  33. package/src/gumbo-parser/src/tokenizer.h +123 -0
  34. package/src/gumbo-parser/src/tokenizer_states.h +103 -0
  35. package/src/gumbo-parser/src/utf8.c +270 -0
  36. package/src/gumbo-parser/src/utf8.h +132 -0
  37. package/src/gumbo-parser/src/util.c +58 -0
  38. package/src/gumbo-parser/src/util.h +60 -0
  39. package/src/gumbo-parser/src/vector.c +123 -0
  40. package/src/gumbo-parser/src/vector.h +67 -0
  41. package/src/html_document.cc +411 -0
  42. package/src/html_document.h +56 -0
  43. package/src/html_element.cc +963 -0
  44. package/src/html_element.h +70 -0
  45. package/src/include/win/strings.h +11 -0
  46. package/src/jsa.c +182 -0
  47. package/src/jsa.h +44 -0
  48. package/src/xnode.c +372 -0
  49. package/src/xnode_query.c +330 -0
  50. package/src/xnode_query.h +186 -0
  51. package/src/xnode_query_parser.c +414 -0
  52. package/install.js +0 -15
@@ -0,0 +1,4 @@
1
+ // Generated via `gentags.py src/tag.in`.
2
+ // Do not edit; edit src/tag.in instead.
3
+ // clang-format off
4
+ 4, 4, 5, 4, 4, 4, 5, 6, 8, 8, 4, 7, 7, 3, 5, 2, 2, 2, 2, 2, 2, 6, 6, 6, 7, 1, 2, 3, 10, 2, 2, 2, 2, 2, 2, 6, 10, 4, 3, 1, 2, 6, 5, 1, 4, 1, 3, 4, 4, 4, 4, 3, 4, 3, 3, 3, 1, 1, 1, 4, 4, 2, 2, 3, 3, 4, 2, 3, 3, 3, 5, 3, 6, 5, 6, 5, 5, 5, 6, 5, 6, 3, 4, 4, 2, 2, 2, 2, 5, 6, 10, 14, 3, 13, 4, 5, 7, 8, 3, 5, 5, 5, 2, 2, 2, 4, 8, 6, 5, 5, 6, 6, 8, 8, 6, 8, 6, 6, 8, 5, 7, 7, 4, 8, 6, 7, 7, 3, 5, 8, 8, 7, 7, 3, 6, 7, 9, 2, 6, 8, 3, 5, 6, 4, 7, 8, 4, 6, 2, 3,
@@ -0,0 +1,153 @@
1
+ // Generated via `gentags.py src/tag.in`.
2
+ // Do not edit; edit src/tag.in instead.
3
+ // clang-format off
4
+ "html",
5
+ "head",
6
+ "title",
7
+ "base",
8
+ "link",
9
+ "meta",
10
+ "style",
11
+ "script",
12
+ "noscript",
13
+ "template",
14
+ "body",
15
+ "article",
16
+ "section",
17
+ "nav",
18
+ "aside",
19
+ "h1",
20
+ "h2",
21
+ "h3",
22
+ "h4",
23
+ "h5",
24
+ "h6",
25
+ "hgroup",
26
+ "header",
27
+ "footer",
28
+ "address",
29
+ "p",
30
+ "hr",
31
+ "pre",
32
+ "blockquote",
33
+ "ol",
34
+ "ul",
35
+ "li",
36
+ "dl",
37
+ "dt",
38
+ "dd",
39
+ "figure",
40
+ "figcaption",
41
+ "main",
42
+ "div",
43
+ "a",
44
+ "em",
45
+ "strong",
46
+ "small",
47
+ "s",
48
+ "cite",
49
+ "q",
50
+ "dfn",
51
+ "abbr",
52
+ "data",
53
+ "time",
54
+ "code",
55
+ "var",
56
+ "samp",
57
+ "kbd",
58
+ "sub",
59
+ "sup",
60
+ "i",
61
+ "b",
62
+ "u",
63
+ "mark",
64
+ "ruby",
65
+ "rt",
66
+ "rp",
67
+ "bdi",
68
+ "bdo",
69
+ "span",
70
+ "br",
71
+ "wbr",
72
+ "ins",
73
+ "del",
74
+ "image",
75
+ "img",
76
+ "iframe",
77
+ "embed",
78
+ "object",
79
+ "param",
80
+ "video",
81
+ "audio",
82
+ "source",
83
+ "track",
84
+ "canvas",
85
+ "map",
86
+ "area",
87
+ "math",
88
+ "mi",
89
+ "mo",
90
+ "mn",
91
+ "ms",
92
+ "mtext",
93
+ "mglyph",
94
+ "malignmark",
95
+ "annotation-xml",
96
+ "svg",
97
+ "foreignobject",
98
+ "desc",
99
+ "table",
100
+ "caption",
101
+ "colgroup",
102
+ "col",
103
+ "tbody",
104
+ "thead",
105
+ "tfoot",
106
+ "tr",
107
+ "td",
108
+ "th",
109
+ "form",
110
+ "fieldset",
111
+ "legend",
112
+ "label",
113
+ "input",
114
+ "button",
115
+ "select",
116
+ "datalist",
117
+ "optgroup",
118
+ "option",
119
+ "textarea",
120
+ "keygen",
121
+ "output",
122
+ "progress",
123
+ "meter",
124
+ "details",
125
+ "summary",
126
+ "menu",
127
+ "menuitem",
128
+ "applet",
129
+ "acronym",
130
+ "bgsound",
131
+ "dir",
132
+ "frame",
133
+ "frameset",
134
+ "noframes",
135
+ "isindex",
136
+ "listing",
137
+ "xmp",
138
+ "nextid",
139
+ "noembed",
140
+ "plaintext",
141
+ "rb",
142
+ "strike",
143
+ "basefont",
144
+ "big",
145
+ "blink",
146
+ "center",
147
+ "font",
148
+ "marquee",
149
+ "multicol",
150
+ "nobr",
151
+ "spacer",
152
+ "tt",
153
+ "rtc",
@@ -0,0 +1,41 @@
1
+ // Copyright 2011 Google Inc. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ // Author: jdtang@google.com (Jonathan Tang)
16
+
17
+ #ifndef GUMBO_TOKEN_TYPE_H_
18
+ #define GUMBO_TOKEN_TYPE_H_
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ // An enum representing the type of token.
25
+ typedef enum {
26
+ GUMBO_TOKEN_DOCTYPE,
27
+ GUMBO_TOKEN_START_TAG,
28
+ GUMBO_TOKEN_END_TAG,
29
+ GUMBO_TOKEN_COMMENT,
30
+ GUMBO_TOKEN_WHITESPACE,
31
+ GUMBO_TOKEN_CHARACTER,
32
+ GUMBO_TOKEN_CDATA,
33
+ GUMBO_TOKEN_NULL,
34
+ GUMBO_TOKEN_EOF
35
+ } GumboTokenType;
36
+
37
+ #ifdef __cplusplus
38
+ } // extern C
39
+ #endif
40
+
41
+ #endif // GUMBO_TOKEN_TYPE_H_