gumbo-html 0.2.3 → 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,57 @@
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_INSERTION_MODE_H_
18
+ #define GUMBO_INSERTION_MODE_H_
19
+
20
+ #ifdef __cplusplus
21
+ extern "C" {
22
+ #endif
23
+
24
+ // http://www.whatwg.org/specs/web-apps/current-work/complete/parsing.html#insertion-mode
25
+ // If new enum values are added, be sure to update the kTokenHandlers dispatch
26
+ // table in parser.c.
27
+ typedef enum {
28
+ GUMBO_INSERTION_MODE_INITIAL,
29
+ GUMBO_INSERTION_MODE_BEFORE_HTML,
30
+ GUMBO_INSERTION_MODE_BEFORE_HEAD,
31
+ GUMBO_INSERTION_MODE_IN_HEAD,
32
+ GUMBO_INSERTION_MODE_IN_HEAD_NOSCRIPT,
33
+ GUMBO_INSERTION_MODE_AFTER_HEAD,
34
+ GUMBO_INSERTION_MODE_IN_BODY,
35
+ GUMBO_INSERTION_MODE_TEXT,
36
+ GUMBO_INSERTION_MODE_IN_TABLE,
37
+ GUMBO_INSERTION_MODE_IN_TABLE_TEXT,
38
+ GUMBO_INSERTION_MODE_IN_CAPTION,
39
+ GUMBO_INSERTION_MODE_IN_COLUMN_GROUP,
40
+ GUMBO_INSERTION_MODE_IN_TABLE_BODY,
41
+ GUMBO_INSERTION_MODE_IN_ROW,
42
+ GUMBO_INSERTION_MODE_IN_CELL,
43
+ GUMBO_INSERTION_MODE_IN_SELECT,
44
+ GUMBO_INSERTION_MODE_IN_SELECT_IN_TABLE,
45
+ GUMBO_INSERTION_MODE_IN_TEMPLATE,
46
+ GUMBO_INSERTION_MODE_AFTER_BODY,
47
+ GUMBO_INSERTION_MODE_IN_FRAMESET,
48
+ GUMBO_INSERTION_MODE_AFTER_FRAMESET,
49
+ GUMBO_INSERTION_MODE_AFTER_AFTER_BODY,
50
+ GUMBO_INSERTION_MODE_AFTER_AFTER_FRAMESET
51
+ } GumboInsertionMode;
52
+
53
+ #ifdef __cplusplus
54
+ } // extern C
55
+ #endif
56
+
57
+ #endif // GUMBO_INSERTION_MODE_H_