readability_js 0.0.1

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 (1607) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.rspec +2 -0
  4. data/CHANGELOG.md +2 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE +21 -0
  8. data/README.md +119 -0
  9. data/Rakefile +30 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/cli/pry.rb +5 -0
  13. data/lib/custom_errors/error.rb +4 -0
  14. data/lib/readability_js/node/node_modules/.bin/tldts +1 -0
  15. data/lib/readability_js/node/node_modules/.yarn-integrity +67 -0
  16. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/LICENSE +21 -0
  17. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/README.md +316 -0
  18. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js +220 -0
  19. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/browser/css-color.min.js.map +1 -0
  20. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs +5666 -0
  21. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.cjs.map +1 -0
  22. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/cjs/index.d.cts +109 -0
  23. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.d.ts +17 -0
  24. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.js +27 -0
  25. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/index.js.map +1 -0
  26. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.d.ts +44 -0
  27. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js +82 -0
  28. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/cache.js.map +1 -0
  29. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.d.ts +537 -0
  30. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.js +2833 -0
  31. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/color.js.map +1 -0
  32. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.d.ts +21 -0
  33. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.js +7 -0
  34. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/common.js.map +1 -0
  35. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.d.ts +43 -0
  36. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js +101 -0
  37. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/constant.js.map +1 -0
  38. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.d.ts +99 -0
  39. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js +361 -0
  40. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/convert.js.map +1 -0
  41. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.d.ts +89 -0
  42. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js +860 -0
  43. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-calc.js.map +1 -0
  44. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.d.ts +79 -0
  45. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js +261 -0
  46. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-gradient.js.map +1 -0
  47. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.d.ts +31 -0
  48. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js +195 -0
  49. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/css-var.js.map +1 -0
  50. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.d.ts +29 -0
  51. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js +507 -0
  52. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/relative-color.js.map +1 -0
  53. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.d.ts +52 -0
  54. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js +350 -0
  55. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/resolve.js.map +1 -0
  56. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/typedef.d.ts +80 -0
  57. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.d.ts +45 -0
  58. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.js +279 -0
  59. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/dist/esm/js/util.js.map +1 -0
  60. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/package.json +82 -0
  61. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/index.ts +24 -0
  62. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/cache.ts +114 -0
  63. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/color.ts +3511 -0
  64. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/common.ts +31 -0
  65. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/constant.ts +68 -0
  66. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/convert.ts +469 -0
  67. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-calc.ts +965 -0
  68. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-gradient.ts +384 -0
  69. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/css-var.ts +250 -0
  70. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/relative-color.ts +603 -0
  71. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/resolve.ts +443 -0
  72. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/typedef.ts +88 -0
  73. data/lib/readability_js/node/node_modules/@asamuzakjp/css-color/src/js/util.ts +336 -0
  74. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/LICENSE +21 -0
  75. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/README.md +324 -0
  76. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.cjs +4613 -0
  77. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.cjs.map +1 -0
  78. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/dist/cjs/index.d.cts +16 -0
  79. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/package.json +83 -0
  80. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/index.js +353 -0
  81. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/constant.js +129 -0
  82. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/finder.js +3108 -0
  83. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/matcher.js +587 -0
  84. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/parser.js +431 -0
  85. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/src/js/utility.js +1107 -0
  86. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/index.d.ts +14 -0
  87. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/constant.d.ts +79 -0
  88. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/finder.d.ts +64 -0
  89. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/matcher.d.ts +16 -0
  90. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/parser.d.ts +14 -0
  91. data/lib/readability_js/node/node_modules/@asamuzakjp/dom-selector/types/js/utility.d.ts +30 -0
  92. data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/LICENSE +22 -0
  93. data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/README.md +132 -0
  94. data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/package.json +43 -0
  95. data/lib/readability_js/node/node_modules/@asamuzakjp/nwsapi/src/nwsapi.js +1855 -0
  96. data/lib/readability_js/node/node_modules/@csstools/color-helpers/CHANGELOG.md +10 -0
  97. data/lib/readability_js/node/node_modules/@csstools/color-helpers/LICENSE.md +18 -0
  98. data/lib/readability_js/node/node_modules/@csstools/color-helpers/README.md +32 -0
  99. data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.cjs +263 -0
  100. data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.d.ts +429 -0
  101. data/lib/readability_js/node/node_modules/@csstools/color-helpers/dist/index.mjs +263 -0
  102. data/lib/readability_js/node/node_modules/@csstools/color-helpers/package.json +62 -0
  103. data/lib/readability_js/node/node_modules/@csstools/css-calc/CHANGELOG.md +10 -0
  104. data/lib/readability_js/node/node_modules/@csstools/css-calc/LICENSE.md +20 -0
  105. data/lib/readability_js/node/node_modules/@csstools/css-calc/README.md +132 -0
  106. data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.cjs +1 -0
  107. data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.d.ts +71 -0
  108. data/lib/readability_js/node/node_modules/@csstools/css-calc/dist/index.mjs +1 -0
  109. data/lib/readability_js/node/node_modules/@csstools/css-calc/package.json +66 -0
  110. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/CHANGELOG.md +13 -0
  111. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/LICENSE.md +20 -0
  112. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/README.md +37 -0
  113. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.cjs +1 -0
  114. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.d.ts +168 -0
  115. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/dist/index.mjs +1 -0
  116. data/lib/readability_js/node/node_modules/@csstools/css-color-parser/package.json +71 -0
  117. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md +9 -0
  118. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/LICENSE.md +20 -0
  119. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/README.md +119 -0
  120. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.cjs +1 -0
  121. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts +604 -0
  122. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/dist/index.mjs +1 -0
  123. data/lib/readability_js/node/node_modules/@csstools/css-parser-algorithms/package.json +65 -0
  124. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/CHANGELOG.md +9 -0
  125. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/LICENSE.md +18 -0
  126. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/README.md +43 -0
  127. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.d.ts +5 -0
  128. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/dist/index.json +765 -0
  129. data/lib/readability_js/node/node_modules/@csstools/css-syntax-patches-for-csstree/package.json +54 -0
  130. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/CHANGELOG.md +9 -0
  131. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/LICENSE.md +20 -0
  132. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/README.md +111 -0
  133. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.cjs +1 -0
  134. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.d.ts +593 -0
  135. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/dist/index.mjs +1 -0
  136. data/lib/readability_js/node/node_modules/@csstools/css-tokenizer/package.json +62 -0
  137. data/lib/readability_js/node/node_modules/@mozilla/readability/.prettierrc.js +13 -0
  138. data/lib/readability_js/node/node_modules/@mozilla/readability/CHANGELOG.md +104 -0
  139. data/lib/readability_js/node/node_modules/@mozilla/readability/CODE_OF_CONDUCT.md +15 -0
  140. data/lib/readability_js/node/node_modules/@mozilla/readability/CONTRIBUTING.md +78 -0
  141. data/lib/readability_js/node/node_modules/@mozilla/readability/JSDOMParser.js +1278 -0
  142. data/lib/readability_js/node/node_modules/@mozilla/readability/LICENSE.md +13 -0
  143. data/lib/readability_js/node/node_modules/@mozilla/readability/README.md +129 -0
  144. data/lib/readability_js/node/node_modules/@mozilla/readability/Readability-readerable.js +122 -0
  145. data/lib/readability_js/node/node_modules/@mozilla/readability/Readability.js +2786 -0
  146. data/lib/readability_js/node/node_modules/@mozilla/readability/SECURITY.md +8 -0
  147. data/lib/readability_js/node/node_modules/@mozilla/readability/eslint.config.mjs +55 -0
  148. data/lib/readability_js/node/node_modules/@mozilla/readability/index.d.ts +64 -0
  149. data/lib/readability_js/node/node_modules/@mozilla/readability/index.js +8 -0
  150. data/lib/readability_js/node/node_modules/@mozilla/readability/package.json +41 -0
  151. data/lib/readability_js/node/node_modules/agent-base/LICENSE +22 -0
  152. data/lib/readability_js/node/node_modules/agent-base/README.md +69 -0
  153. data/lib/readability_js/node/node_modules/agent-base/dist/helpers.d.ts +15 -0
  154. data/lib/readability_js/node/node_modules/agent-base/dist/helpers.d.ts.map +1 -0
  155. data/lib/readability_js/node/node_modules/agent-base/dist/helpers.js +66 -0
  156. data/lib/readability_js/node/node_modules/agent-base/dist/helpers.js.map +1 -0
  157. data/lib/readability_js/node/node_modules/agent-base/dist/index.d.ts +41 -0
  158. data/lib/readability_js/node/node_modules/agent-base/dist/index.d.ts.map +1 -0
  159. data/lib/readability_js/node/node_modules/agent-base/dist/index.js +178 -0
  160. data/lib/readability_js/node/node_modules/agent-base/dist/index.js.map +1 -0
  161. data/lib/readability_js/node/node_modules/agent-base/package.json +46 -0
  162. data/lib/readability_js/node/node_modules/bidi-js/LICENSE.txt +22 -0
  163. data/lib/readability_js/node/node_modules/bidi-js/README.md +133 -0
  164. data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.js +1010 -0
  165. data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.min.js +1 -0
  166. data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.min.mjs +1 -0
  167. data/lib/readability_js/node/node_modules/bidi-js/dist/bidi.mjs +1002 -0
  168. data/lib/readability_js/node/node_modules/bidi-js/package.json +39 -0
  169. data/lib/readability_js/node/node_modules/bidi-js/src/brackets.js +30 -0
  170. data/lib/readability_js/node/node_modules/bidi-js/src/charTypes.js +66 -0
  171. data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiBrackets.data.js +5 -0
  172. data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiCharTypes.data.js +25 -0
  173. data/lib/readability_js/node/node_modules/bidi-js/src/data/bidiMirroring.data.js +2 -0
  174. data/lib/readability_js/node/node_modules/bidi-js/src/embeddingLevels.js +690 -0
  175. data/lib/readability_js/node/node_modules/bidi-js/src/index.js +5 -0
  176. data/lib/readability_js/node/node_modules/bidi-js/src/mirroring.js +48 -0
  177. data/lib/readability_js/node/node_modules/bidi-js/src/reordering.js +99 -0
  178. data/lib/readability_js/node/node_modules/bidi-js/src/util/parseCharacterMap.js +30 -0
  179. data/lib/readability_js/node/node_modules/css-tree/LICENSE +19 -0
  180. data/lib/readability_js/node/node_modules/css-tree/README.md +192 -0
  181. data/lib/readability_js/node/node_modules/css-tree/cjs/convertor/create.cjs +32 -0
  182. data/lib/readability_js/node/node_modules/css-tree/cjs/convertor/index.cjs +8 -0
  183. data/lib/readability_js/node/node_modules/css-tree/cjs/data-patch.cjs +7 -0
  184. data/lib/readability_js/node/node_modules/css-tree/cjs/data.cjs +120 -0
  185. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs +16 -0
  186. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/generate.cjs +139 -0
  187. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/index.cjs +13 -0
  188. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/parse.cjs +556 -0
  189. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/scanner.cjs +113 -0
  190. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs +59 -0
  191. data/lib/readability_js/node/node_modules/css-tree/cjs/definition-syntax/walk.cjs +57 -0
  192. data/lib/readability_js/node/node_modules/css-tree/cjs/generator/create.cjs +102 -0
  193. data/lib/readability_js/node/node_modules/css-tree/cjs/generator/index.cjs +8 -0
  194. data/lib/readability_js/node/node_modules/css-tree/cjs/generator/sourceMap.cjs +96 -0
  195. data/lib/readability_js/node/node_modules/css-tree/cjs/generator/token-before.cjs +170 -0
  196. data/lib/readability_js/node/node_modules/css-tree/cjs/index.cjs +65 -0
  197. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/Lexer.cjs +517 -0
  198. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/error.cjs +128 -0
  199. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs +235 -0
  200. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-const.cjs +12 -0
  201. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic-urange.cjs +149 -0
  202. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/generic.cjs +589 -0
  203. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/index.cjs +7 -0
  204. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/match-graph.cjs +530 -0
  205. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/match.cjs +632 -0
  206. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/prepare-tokens.cjs +54 -0
  207. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/search.cjs +65 -0
  208. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/structure.cjs +173 -0
  209. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/trace.cjs +73 -0
  210. data/lib/readability_js/node/node_modules/css-tree/cjs/lexer/units.cjs +38 -0
  211. data/lib/readability_js/node/node_modules/css-tree/cjs/parser/SyntaxError.cjs +74 -0
  212. data/lib/readability_js/node/node_modules/css-tree/cjs/parser/create.cjs +340 -0
  213. data/lib/readability_js/node/node_modules/css-tree/cjs/parser/index.cjs +8 -0
  214. data/lib/readability_js/node/node_modules/css-tree/cjs/parser/parse-selector.cjs +8 -0
  215. data/lib/readability_js/node/node_modules/css-tree/cjs/parser/sequence.cjs +47 -0
  216. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/container.cjs +32 -0
  217. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/font-face.cjs +12 -0
  218. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/import.cjs +101 -0
  219. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/index.cjs +27 -0
  220. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/layer.cjs +16 -0
  221. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/media.cjs +16 -0
  222. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/nest.cjs +16 -0
  223. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/page.cjs +16 -0
  224. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/scope.cjs +16 -0
  225. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/starting-style.cjs +12 -0
  226. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/atrule/supports.cjs +16 -0
  227. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/generator.cjs +9 -0
  228. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/lexer.cjs +14 -0
  229. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/mix.cjs +127 -0
  230. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/parser-selector.cjs +19 -0
  231. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/parser.cjs +49 -0
  232. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/config/walker.cjs +9 -0
  233. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/create.cjs +58 -0
  234. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/function/expression.cjs +11 -0
  235. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/function/var.cjs +43 -0
  236. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/index.cjs +14 -0
  237. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs +293 -0
  238. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Atrule.cjs +103 -0
  239. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs +52 -0
  240. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs +148 -0
  241. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Block.cjs +96 -0
  242. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Brackets.cjs +38 -0
  243. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/CDC.cjs +26 -0
  244. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/CDO.cjs +26 -0
  245. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/ClassSelector.cjs +31 -0
  246. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Combinator.cjs +61 -0
  247. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Comment.cjs +40 -0
  248. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Condition.cjs +120 -0
  249. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Declaration.cjs +166 -0
  250. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/DeclarationList.cjs +62 -0
  251. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Dimension.cjs +30 -0
  252. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Feature.cjs +101 -0
  253. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/FeatureFunction.cjs +67 -0
  254. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/FeatureRange.cjs +133 -0
  255. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Function.cjs +45 -0
  256. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/GeneralEnclosed.cjs +68 -0
  257. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Hash.cjs +30 -0
  258. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/IdSelector.cjs +33 -0
  259. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Identifier.cjs +25 -0
  260. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Layer.cjs +35 -0
  261. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerList.cjs +43 -0
  262. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerName.cjs +34 -0
  263. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/LayerNameList.cjs +42 -0
  264. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaCondition.cjs +70 -0
  265. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaFeature.cjs +76 -0
  266. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaFeatureRange.cjs +11 -0
  267. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaQuery.cjs +100 -0
  268. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/MediaQueryList.cjs +41 -0
  269. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/NestingSelector.cjs +29 -0
  270. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Nth.cjs +54 -0
  271. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Number.cjs +25 -0
  272. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Operator.cjs +28 -0
  273. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Parentheses.cjs +38 -0
  274. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Percentage.cjs +25 -0
  275. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/PseudoClassSelector.cjs +67 -0
  276. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/PseudoElementSelector.cjs +69 -0
  277. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Ratio.cjs +71 -0
  278. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Raw.cjs +48 -0
  279. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Rule.cjs +58 -0
  280. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Scope.cjs +69 -0
  281. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Selector.cjs +38 -0
  282. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SelectorList.cjs +43 -0
  283. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/String.cjs +26 -0
  284. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/StyleSheet.cjs +83 -0
  285. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SupportsDeclaration.cjs +38 -0
  286. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/SupportsFeature.cjs +69 -0
  287. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs +59 -0
  288. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs +158 -0
  289. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Url.cjs +54 -0
  290. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/Value.cjs +26 -0
  291. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/WhiteSpace.cjs +34 -0
  292. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/common/feature-range.cjs +112 -0
  293. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/common/feature.cjs +76 -0
  294. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-generate.cjs +103 -0
  295. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-parse-selector.cjs +39 -0
  296. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index-parse.cjs +103 -0
  297. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/node/index.cjs +103 -0
  298. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/pseudo/index.cjs +60 -0
  299. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/pseudo/lang.cjs +37 -0
  300. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/atrulePrelude.cjs +9 -0
  301. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/default.cjs +76 -0
  302. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/index.cjs +11 -0
  303. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/selector.cjs +88 -0
  304. data/lib/readability_js/node/node_modules/css-tree/cjs/syntax/scope/value.cjs +29 -0
  305. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/OffsetToLocation.cjs +91 -0
  306. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/TokenStream.cjs +308 -0
  307. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/adopt-buffer.cjs +13 -0
  308. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/char-code-definitions.cjs +236 -0
  309. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/index.cjs +554 -0
  310. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/names.cjs +32 -0
  311. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/types.cjs +57 -0
  312. data/lib/readability_js/node/node_modules/css-tree/cjs/tokenizer/utils.cjs +261 -0
  313. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/List.cjs +473 -0
  314. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/clone.cjs +25 -0
  315. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/create-custom-error.cjs +18 -0
  316. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/ident.cjs +102 -0
  317. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/index.cjs +20 -0
  318. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/names.cjs +113 -0
  319. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/string.cjs +99 -0
  320. data/lib/readability_js/node/node_modules/css-tree/cjs/utils/url.cjs +108 -0
  321. data/lib/readability_js/node/node_modules/css-tree/cjs/version.cjs +5 -0
  322. data/lib/readability_js/node/node_modules/css-tree/cjs/walker/create.cjs +291 -0
  323. data/lib/readability_js/node/node_modules/css-tree/cjs/walker/index.cjs +8 -0
  324. data/lib/readability_js/node/node_modules/css-tree/data/patch.json +982 -0
  325. data/lib/readability_js/node/node_modules/css-tree/dist/csstree.esm.js +12 -0
  326. data/lib/readability_js/node/node_modules/css-tree/dist/csstree.js +12 -0
  327. data/lib/readability_js/node/node_modules/css-tree/dist/data.cjs +1308 -0
  328. data/lib/readability_js/node/node_modules/css-tree/dist/data.js +1308 -0
  329. data/lib/readability_js/node/node_modules/css-tree/dist/version.cjs +1 -0
  330. data/lib/readability_js/node/node_modules/css-tree/dist/version.js +1 -0
  331. data/lib/readability_js/node/node_modules/css-tree/lib/convertor/create.js +28 -0
  332. data/lib/readability_js/node/node_modules/css-tree/lib/convertor/index.js +4 -0
  333. data/lib/readability_js/node/node_modules/css-tree/lib/data-patch.js +6 -0
  334. data/lib/readability_js/node/node_modules/css-tree/lib/data.js +118 -0
  335. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/SyntaxError.js +12 -0
  336. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/generate.js +135 -0
  337. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/index.js +4 -0
  338. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/parse.js +552 -0
  339. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/scanner.js +109 -0
  340. data/lib/readability_js/node/node_modules/css-tree/lib/definition-syntax/walk.js +53 -0
  341. data/lib/readability_js/node/node_modules/css-tree/lib/generator/create.js +97 -0
  342. data/lib/readability_js/node/node_modules/css-tree/lib/generator/index.js +4 -0
  343. data/lib/readability_js/node/node_modules/css-tree/lib/generator/sourceMap.js +92 -0
  344. data/lib/readability_js/node/node_modules/css-tree/lib/generator/token-before.js +182 -0
  345. data/lib/readability_js/node/node_modules/css-tree/lib/index.js +30 -0
  346. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/Lexer.js +511 -0
  347. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/error.js +123 -0
  348. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-an-plus-b.js +238 -0
  349. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-const.js +8 -0
  350. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic-urange.js +151 -0
  351. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/generic.js +622 -0
  352. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/index.js +1 -0
  353. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/match-graph.js +527 -0
  354. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/match.js +630 -0
  355. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/prepare-tokens.js +50 -0
  356. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/search.js +61 -0
  357. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/structure.js +169 -0
  358. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/trace.js +66 -0
  359. data/lib/readability_js/node/node_modules/css-tree/lib/lexer/units.js +27 -0
  360. data/lib/readability_js/node/node_modules/css-tree/lib/parser/SyntaxError.js +70 -0
  361. data/lib/readability_js/node/node_modules/css-tree/lib/parser/create.js +350 -0
  362. data/lib/readability_js/node/node_modules/css-tree/lib/parser/index.js +4 -0
  363. data/lib/readability_js/node/node_modules/css-tree/lib/parser/parse-selector.js +4 -0
  364. data/lib/readability_js/node/node_modules/css-tree/lib/parser/sequence.js +43 -0
  365. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/container.js +28 -0
  366. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/font-face.js +8 -0
  367. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/import.js +104 -0
  368. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/index.js +23 -0
  369. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/layer.js +12 -0
  370. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/media.js +12 -0
  371. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/nest.js +12 -0
  372. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/page.js +12 -0
  373. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/scope.js +12 -0
  374. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/starting-style.js +8 -0
  375. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/atrule/supports.js +12 -0
  376. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/generator.js +5 -0
  377. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/lexer.js +10 -0
  378. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/mix.js +123 -0
  379. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/parser-selector.js +15 -0
  380. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/parser.js +45 -0
  381. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/config/walker.js +5 -0
  382. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/create.js +55 -0
  383. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/function/expression.js +7 -0
  384. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/function/var.js +39 -0
  385. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/index.js +10 -0
  386. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AnPlusB.js +292 -0
  387. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Atrule.js +100 -0
  388. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AtrulePrelude.js +47 -0
  389. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/AttributeSelector.js +147 -0
  390. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Block.js +95 -0
  391. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Brackets.js +35 -0
  392. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/CDC.js +19 -0
  393. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/CDO.js +19 -0
  394. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/ClassSelector.js +24 -0
  395. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Combinator.js +54 -0
  396. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Comment.js +33 -0
  397. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Condition.js +123 -0
  398. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Declaration.js +165 -0
  399. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/DeclarationList.js +62 -0
  400. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Dimension.js +23 -0
  401. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Feature.js +103 -0
  402. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/FeatureFunction.js +63 -0
  403. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/FeatureRange.js +133 -0
  404. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Function.js +41 -0
  405. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/GeneralEnclosed.js +66 -0
  406. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Hash.js +23 -0
  407. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/IdSelector.js +26 -0
  408. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Identifier.js +18 -0
  409. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Layer.js +28 -0
  410. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/LayerList.js +36 -0
  411. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/MediaQuery.js +102 -0
  412. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/MediaQueryList.js +34 -0
  413. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/NestingSelector.js +22 -0
  414. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Nth.js +47 -0
  415. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Number.js +18 -0
  416. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Operator.js +21 -0
  417. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Parentheses.js +34 -0
  418. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Percentage.js +18 -0
  419. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/PseudoClassSelector.js +65 -0
  420. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/PseudoElementSelector.js +66 -0
  421. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Ratio.js +68 -0
  422. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Raw.js +41 -0
  423. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Rule.js +51 -0
  424. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Scope.js +66 -0
  425. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Selector.js +31 -0
  426. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/SelectorList.js +35 -0
  427. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/String.js +19 -0
  428. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/StyleSheet.js +82 -0
  429. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/SupportsDeclaration.js +34 -0
  430. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/TypeSelector.js +52 -0
  431. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/UnicodeRange.js +156 -0
  432. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Url.js +52 -0
  433. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/Value.js +19 -0
  434. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/WhiteSpace.js +27 -0
  435. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-generate.js +49 -0
  436. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-parse-selector.js +17 -0
  437. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index-parse.js +49 -0
  438. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/node/index.js +49 -0
  439. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/pseudo/index.js +56 -0
  440. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/pseudo/lang.js +33 -0
  441. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/atrulePrelude.js +5 -0
  442. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/default.js +85 -0
  443. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/index.js +3 -0
  444. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/selector.js +94 -0
  445. data/lib/readability_js/node/node_modules/css-tree/lib/syntax/scope/value.js +25 -0
  446. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/OffsetToLocation.js +87 -0
  447. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/TokenStream.js +316 -0
  448. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/adopt-buffer.js +9 -0
  449. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/char-code-definitions.js +212 -0
  450. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/index.js +513 -0
  451. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/names.js +28 -0
  452. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/types.js +28 -0
  453. data/lib/readability_js/node/node_modules/css-tree/lib/tokenizer/utils.js +254 -0
  454. data/lib/readability_js/node/node_modules/css-tree/lib/utils/List.js +469 -0
  455. data/lib/readability_js/node/node_modules/css-tree/lib/utils/clone.js +21 -0
  456. data/lib/readability_js/node/node_modules/css-tree/lib/utils/create-custom-error.js +14 -0
  457. data/lib/readability_js/node/node_modules/css-tree/lib/utils/ident.js +101 -0
  458. data/lib/readability_js/node/node_modules/css-tree/lib/utils/index.js +6 -0
  459. data/lib/readability_js/node/node_modules/css-tree/lib/utils/names.js +106 -0
  460. data/lib/readability_js/node/node_modules/css-tree/lib/utils/string.js +99 -0
  461. data/lib/readability_js/node/node_modules/css-tree/lib/utils/url.js +108 -0
  462. data/lib/readability_js/node/node_modules/css-tree/lib/version.js +5 -0
  463. data/lib/readability_js/node/node_modules/css-tree/lib/walker/create.js +287 -0
  464. data/lib/readability_js/node/node_modules/css-tree/lib/walker/index.js +4 -0
  465. data/lib/readability_js/node/node_modules/css-tree/package.json +125 -0
  466. data/lib/readability_js/node/node_modules/cssstyle/LICENSE +20 -0
  467. data/lib/readability_js/node/node_modules/cssstyle/README.md +11 -0
  468. data/lib/readability_js/node/node_modules/cssstyle/lib/CSSStyleDeclaration.js +636 -0
  469. data/lib/readability_js/node/node_modules/cssstyle/lib/generated/allProperties.js +653 -0
  470. data/lib/readability_js/node/node_modules/cssstyle/lib/generated/implementedProperties.js +2222 -0
  471. data/lib/readability_js/node/node_modules/cssstyle/lib/generated/properties.js +6951 -0
  472. data/lib/readability_js/node/node_modules/cssstyle/lib/normalize.js +1417 -0
  473. data/lib/readability_js/node/node_modules/cssstyle/lib/parsers.js +535 -0
  474. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/background.js +396 -0
  475. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundAttachment.js +64 -0
  476. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundClip.js +64 -0
  477. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundColor.js +55 -0
  478. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundImage.js +78 -0
  479. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundOrigin.js +64 -0
  480. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundPosition.js +193 -0
  481. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundRepeat.js +89 -0
  482. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/backgroundSize.js +120 -0
  483. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/border.js +164 -0
  484. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottom.js +156 -0
  485. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomColor.js +60 -0
  486. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomStyle.js +59 -0
  487. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderBottomWidth.js +69 -0
  488. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderCollapse.js +50 -0
  489. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderColor.js +116 -0
  490. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeft.js +156 -0
  491. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftColor.js +60 -0
  492. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftStyle.js +59 -0
  493. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderLeftWidth.js +69 -0
  494. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRight.js +156 -0
  495. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightColor.js +60 -0
  496. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightStyle.js +59 -0
  497. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderRightWidth.js +69 -0
  498. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderSpacing.js +62 -0
  499. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderStyle.js +116 -0
  500. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTop.js +156 -0
  501. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopColor.js +60 -0
  502. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopStyle.js +59 -0
  503. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderTopWidth.js +69 -0
  504. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/borderWidth.js +129 -0
  505. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/bottom.js +58 -0
  506. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/clear.js +50 -0
  507. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/clip.js +68 -0
  508. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/color.js +51 -0
  509. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/display.js +207 -0
  510. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flex.js +176 -0
  511. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexBasis.js +62 -0
  512. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexGrow.js +61 -0
  513. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/flexShrink.js +61 -0
  514. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/float.js +50 -0
  515. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/floodColor.js +51 -0
  516. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/font.js +289 -0
  517. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontFamily.js +94 -0
  518. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontSize.js +64 -0
  519. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontStyle.js +63 -0
  520. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontVariant.js +73 -0
  521. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/fontWeight.js +68 -0
  522. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/height.js +58 -0
  523. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/left.js +58 -0
  524. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/lightingColor.js +51 -0
  525. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/lineHeight.js +66 -0
  526. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/margin.js +95 -0
  527. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginBottom.js +64 -0
  528. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginLeft.js +64 -0
  529. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginRight.js +64 -0
  530. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/marginTop.js +64 -0
  531. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/opacity.js +59 -0
  532. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/outlineColor.js +51 -0
  533. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/padding.js +93 -0
  534. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingBottom.js +65 -0
  535. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingLeft.js +65 -0
  536. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingRight.js +65 -0
  537. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/paddingTop.js +65 -0
  538. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/right.js +58 -0
  539. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/stopColor.js +51 -0
  540. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/top.js +58 -0
  541. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderAfterColor.js +51 -0
  542. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderBeforeColor.js +51 -0
  543. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderEndColor.js +51 -0
  544. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitBorderStartColor.js +51 -0
  545. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitColumnRuleColor.js +51 -0
  546. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTapHighlightColor.js +51 -0
  547. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextEmphasisColor.js +51 -0
  548. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextFillColor.js +51 -0
  549. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/webkitTextStrokeColor.js +51 -0
  550. data/lib/readability_js/node/node_modules/cssstyle/lib/properties/width.js +58 -0
  551. data/lib/readability_js/node/node_modules/cssstyle/lib/utils/allExtraProperties.js +155 -0
  552. data/lib/readability_js/node/node_modules/cssstyle/lib/utils/camelize.js +37 -0
  553. data/lib/readability_js/node/node_modules/cssstyle/lib/utils/propertyDescriptors.js +19 -0
  554. data/lib/readability_js/node/node_modules/cssstyle/lib/utils/strings.js +167 -0
  555. data/lib/readability_js/node/node_modules/cssstyle/package.json +74 -0
  556. data/lib/readability_js/node/node_modules/data-urls/LICENSE.txt +7 -0
  557. data/lib/readability_js/node/node_modules/data-urls/README.md +62 -0
  558. data/lib/readability_js/node/node_modules/data-urls/lib/parser.js +69 -0
  559. data/lib/readability_js/node/node_modules/data-urls/lib/utils.js +20 -0
  560. data/lib/readability_js/node/node_modules/data-urls/package.json +52 -0
  561. data/lib/readability_js/node/node_modules/debug/LICENSE +20 -0
  562. data/lib/readability_js/node/node_modules/debug/README.md +481 -0
  563. data/lib/readability_js/node/node_modules/debug/package.json +64 -0
  564. data/lib/readability_js/node/node_modules/debug/src/browser.js +272 -0
  565. data/lib/readability_js/node/node_modules/debug/src/common.js +292 -0
  566. data/lib/readability_js/node/node_modules/debug/src/index.js +10 -0
  567. data/lib/readability_js/node/node_modules/debug/src/node.js +263 -0
  568. data/lib/readability_js/node/node_modules/decimal.js/LICENCE.md +23 -0
  569. data/lib/readability_js/node/node_modules/decimal.js/README.md +246 -0
  570. data/lib/readability_js/node/node_modules/decimal.js/decimal.d.ts +301 -0
  571. data/lib/readability_js/node/node_modules/decimal.js/decimal.js +4951 -0
  572. data/lib/readability_js/node/node_modules/decimal.js/decimal.mjs +4914 -0
  573. data/lib/readability_js/node/node_modules/decimal.js/package.json +55 -0
  574. data/lib/readability_js/node/node_modules/entities/LICENSE +11 -0
  575. data/lib/readability_js/node/node_modules/entities/decode.d.ts +1 -0
  576. data/lib/readability_js/node/node_modules/entities/decode.js +3 -0
  577. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +19 -0
  578. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.d.ts.map +1 -0
  579. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
  580. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode-codepoint.js.map +1 -0
  581. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.d.ts +209 -0
  582. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.d.ts.map +1 -0
  583. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.js +511 -0
  584. data/lib/readability_js/node/node_modules/entities/dist/commonjs/decode.js.map +1 -0
  585. data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.d.ts +22 -0
  586. data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.d.ts.map +1 -0
  587. data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.js +73 -0
  588. data/lib/readability_js/node/node_modules/entities/dist/commonjs/encode.js.map +1 -0
  589. data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.d.ts +43 -0
  590. data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.d.ts.map +1 -0
  591. data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.js +121 -0
  592. data/lib/readability_js/node/node_modules/entities/dist/commonjs/escape.js.map +1 -0
  593. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +2 -0
  594. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts.map +1 -0
  595. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.js +10 -0
  596. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +1 -0
  597. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +2 -0
  598. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts.map +1 -0
  599. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +10 -0
  600. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +1 -0
  601. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +8 -0
  602. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.d.ts.map +1 -0
  603. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.js +13 -0
  604. data/lib/readability_js/node/node_modules/entities/dist/commonjs/generated/encode-html.js.map +1 -0
  605. data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.d.ts +96 -0
  606. data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.d.ts.map +1 -0
  607. data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.js +131 -0
  608. data/lib/readability_js/node/node_modules/entities/dist/commonjs/index.js.map +1 -0
  609. data/lib/readability_js/node/node_modules/entities/dist/commonjs/package.json +3 -0
  610. data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.d.ts +19 -0
  611. data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.d.ts.map +1 -0
  612. data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.js +72 -0
  613. data/lib/readability_js/node/node_modules/entities/dist/esm/decode-codepoint.js.map +1 -0
  614. data/lib/readability_js/node/node_modules/entities/dist/esm/decode.d.ts +209 -0
  615. data/lib/readability_js/node/node_modules/entities/dist/esm/decode.d.ts.map +1 -0
  616. data/lib/readability_js/node/node_modules/entities/dist/esm/decode.js +497 -0
  617. data/lib/readability_js/node/node_modules/entities/dist/esm/decode.js.map +1 -0
  618. data/lib/readability_js/node/node_modules/entities/dist/esm/encode.d.ts +22 -0
  619. data/lib/readability_js/node/node_modules/entities/dist/esm/encode.d.ts.map +1 -0
  620. data/lib/readability_js/node/node_modules/entities/dist/esm/encode.js +69 -0
  621. data/lib/readability_js/node/node_modules/entities/dist/esm/encode.js.map +1 -0
  622. data/lib/readability_js/node/node_modules/entities/dist/esm/escape.d.ts +43 -0
  623. data/lib/readability_js/node/node_modules/entities/dist/esm/escape.d.ts.map +1 -0
  624. data/lib/readability_js/node/node_modules/entities/dist/esm/escape.js +117 -0
  625. data/lib/readability_js/node/node_modules/entities/dist/esm/escape.js.map +1 -0
  626. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +2 -0
  627. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.d.ts.map +1 -0
  628. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  629. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-html.js.map +1 -0
  630. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +2 -0
  631. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts.map +1 -0
  632. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.js +7 -0
  633. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/decode-data-xml.js.map +1 -0
  634. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.d.ts +8 -0
  635. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.d.ts.map +1 -0
  636. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.js +10 -0
  637. data/lib/readability_js/node/node_modules/entities/dist/esm/generated/encode-html.js.map +1 -0
  638. data/lib/readability_js/node/node_modules/entities/dist/esm/index.d.ts +96 -0
  639. data/lib/readability_js/node/node_modules/entities/dist/esm/index.d.ts.map +1 -0
  640. data/lib/readability_js/node/node_modules/entities/dist/esm/index.js +107 -0
  641. data/lib/readability_js/node/node_modules/entities/dist/esm/index.js.map +1 -0
  642. data/lib/readability_js/node/node_modules/entities/dist/esm/package.json +3 -0
  643. data/lib/readability_js/node/node_modules/entities/escape.d.ts +1 -0
  644. data/lib/readability_js/node/node_modules/entities/escape.js +3 -0
  645. data/lib/readability_js/node/node_modules/entities/package.json +118 -0
  646. data/lib/readability_js/node/node_modules/entities/readme.md +122 -0
  647. data/lib/readability_js/node/node_modules/entities/src/decode-codepoint.ts +81 -0
  648. data/lib/readability_js/node/node_modules/entities/src/decode.spec.ts +320 -0
  649. data/lib/readability_js/node/node_modules/entities/src/decode.ts +620 -0
  650. data/lib/readability_js/node/node_modules/entities/src/encode.spec.ts +78 -0
  651. data/lib/readability_js/node/node_modules/entities/src/encode.ts +77 -0
  652. data/lib/readability_js/node/node_modules/entities/src/escape.spec.ts +14 -0
  653. data/lib/readability_js/node/node_modules/entities/src/escape.ts +148 -0
  654. data/lib/readability_js/node/node_modules/entities/src/generated/.eslintrc.json +10 -0
  655. data/lib/readability_js/node/node_modules/entities/src/generated/decode-data-html.ts +8 -0
  656. data/lib/readability_js/node/node_modules/entities/src/generated/decode-data-xml.ts +8 -0
  657. data/lib/readability_js/node/node_modules/entities/src/generated/encode-html.ts +17 -0
  658. data/lib/readability_js/node/node_modules/entities/src/index.spec.ts +125 -0
  659. data/lib/readability_js/node/node_modules/entities/src/index.ts +188 -0
  660. data/lib/readability_js/node/node_modules/html-encoding-sniffer/LICENSE.txt +7 -0
  661. data/lib/readability_js/node/node_modules/html-encoding-sniffer/README.md +40 -0
  662. data/lib/readability_js/node/node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js +295 -0
  663. data/lib/readability_js/node/node_modules/html-encoding-sniffer/package.json +30 -0
  664. data/lib/readability_js/node/node_modules/http-proxy-agent/LICENSE +22 -0
  665. data/lib/readability_js/node/node_modules/http-proxy-agent/README.md +44 -0
  666. data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.d.ts +44 -0
  667. data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.d.ts.map +1 -0
  668. data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.js +148 -0
  669. data/lib/readability_js/node/node_modules/http-proxy-agent/dist/index.js.map +1 -0
  670. data/lib/readability_js/node/node_modules/http-proxy-agent/package.json +47 -0
  671. data/lib/readability_js/node/node_modules/https-proxy-agent/LICENSE +22 -0
  672. data/lib/readability_js/node/node_modules/https-proxy-agent/README.md +70 -0
  673. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.d.ts +47 -0
  674. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.d.ts.map +1 -0
  675. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.js +180 -0
  676. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  677. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +15 -0
  678. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +1 -0
  679. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
  680. data/lib/readability_js/node/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  681. data/lib/readability_js/node/node_modules/https-proxy-agent/package.json +50 -0
  682. data/lib/readability_js/node/node_modules/iconv-lite/.github/dependabot.yml +11 -0
  683. data/lib/readability_js/node/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
  684. data/lib/readability_js/node/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
  685. data/lib/readability_js/node/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
  686. data/lib/readability_js/node/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
  687. data/lib/readability_js/node/node_modules/iconv-lite/.idea/modules.xml +8 -0
  688. data/lib/readability_js/node/node_modules/iconv-lite/.idea/vcs.xml +6 -0
  689. data/lib/readability_js/node/node_modules/iconv-lite/Changelog.md +212 -0
  690. data/lib/readability_js/node/node_modules/iconv-lite/LICENSE +21 -0
  691. data/lib/readability_js/node/node_modules/iconv-lite/README.md +130 -0
  692. data/lib/readability_js/node/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  693. data/lib/readability_js/node/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  694. data/lib/readability_js/node/node_modules/iconv-lite/encodings/index.js +23 -0
  695. data/lib/readability_js/node/node_modules/iconv-lite/encodings/internal.js +198 -0
  696. data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  697. data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  698. data/lib/readability_js/node/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  699. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  700. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  701. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  702. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  703. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  704. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  705. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  706. data/lib/readability_js/node/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  707. data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf16.js +197 -0
  708. data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf32.js +319 -0
  709. data/lib/readability_js/node/node_modules/iconv-lite/encodings/utf7.js +290 -0
  710. data/lib/readability_js/node/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  711. data/lib/readability_js/node/node_modules/iconv-lite/lib/index.d.ts +41 -0
  712. data/lib/readability_js/node/node_modules/iconv-lite/lib/index.js +180 -0
  713. data/lib/readability_js/node/node_modules/iconv-lite/lib/streams.js +109 -0
  714. data/lib/readability_js/node/node_modules/iconv-lite/package.json +44 -0
  715. data/lib/readability_js/node/node_modules/is-potential-custom-element-name/LICENSE-MIT.txt +20 -0
  716. data/lib/readability_js/node/node_modules/is-potential-custom-element-name/README.md +40 -0
  717. data/lib/readability_js/node/node_modules/is-potential-custom-element-name/index.js +9 -0
  718. data/lib/readability_js/node/node_modules/is-potential-custom-element-name/package.json +35 -0
  719. data/lib/readability_js/node/node_modules/jsdom/LICENSE.txt +22 -0
  720. data/lib/readability_js/node/node_modules/jsdom/README.md +551 -0
  721. data/lib/readability_js/node/node_modules/jsdom/lib/api.js +335 -0
  722. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/Window.js +1022 -0
  723. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/default-stylesheet.css +415 -0
  724. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/js-globals.json +312 -0
  725. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/not-implemented.js +20 -0
  726. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/html.js +208 -0
  727. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/index.js +37 -0
  728. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/parser/xml.js +202 -0
  729. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/async-resource-queue.js +114 -0
  730. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/no-op-resource-loader.js +8 -0
  731. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js +98 -0
  732. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/request-manager.js +33 -0
  733. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js +142 -0
  734. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js +142 -0
  735. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/level2/style.js +57 -0
  736. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/level3/xpath.js +1875 -0
  737. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/aborting/AbortController-impl.js +17 -0
  738. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/aborting/AbortSignal-impl.js +131 -0
  739. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes/Attr-impl.js +60 -0
  740. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes/NamedNodeMap-impl.js +78 -0
  741. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/attributes.js +312 -0
  742. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/constraint-validation/DefaultConstraintValidation-impl.js +75 -0
  743. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/constraint-validation/ValidityState-impl.js +66 -0
  744. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/crypto/Crypto-impl.js +68 -0
  745. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/cssom/StyleSheetList-impl.js +38 -0
  746. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/custom-elements/CustomElementRegistry-impl.js +279 -0
  747. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/custom-elements/ElementInternals-impl.js +56 -0
  748. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/deviceorientation/DeviceMotionEventAcceleration-impl.js +7 -0
  749. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/deviceorientation/DeviceMotionEventRotationRate-impl.js +7 -0
  750. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/documents.js +15 -0
  751. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js +59 -0
  752. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/InnerHTML-impl.js +30 -0
  753. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/XMLSerializer-impl.js +18 -0
  754. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/parse5-adapter-serialization.js +63 -0
  755. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/domparsing/serialization.js +36 -0
  756. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/BeforeUnloadEvent-impl.js +12 -0
  757. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/BlobEvent-impl.js +14 -0
  758. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CloseEvent-impl.js +10 -0
  759. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CompositionEvent-impl.js +20 -0
  760. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/CustomEvent-impl.js +21 -0
  761. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/DeviceMotionEvent-impl.js +49 -0
  762. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/DeviceOrientationEvent-impl.js +10 -0
  763. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/ErrorEvent-impl.js +14 -0
  764. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/Event-impl.js +195 -0
  765. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js +24 -0
  766. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js +438 -0
  767. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/FocusEvent-impl.js +9 -0
  768. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js +14 -0
  769. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js +11 -0
  770. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js +29 -0
  771. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/MessageEvent-impl.js +25 -0
  772. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/MouseEvent-impl.js +72 -0
  773. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PageTransitionEvent-impl.js +20 -0
  774. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PointerEvent-impl.js +21 -0
  775. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PopStateEvent-impl.js +9 -0
  776. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/ProgressEvent-impl.js +14 -0
  777. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/PromiseRejectionEvent-impl.js +14 -0
  778. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/StorageEvent-impl.js +26 -0
  779. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/SubmitEvent-impl.js +13 -0
  780. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/TouchEvent-impl.js +14 -0
  781. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/TransitionEvent-impl.js +10 -0
  782. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/UIEvent-impl.js +43 -0
  783. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/events/WheelEvent-impl.js +12 -0
  784. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/Headers-impl.js +172 -0
  785. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/header-list.js +65 -0
  786. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/fetch/header-types.js +103 -0
  787. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/Blob-impl.js +93 -0
  788. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/File-impl.js +12 -0
  789. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/FileList-impl.js +15 -0
  790. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/file-api/FileReader-impl.js +130 -0
  791. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbortController.js +143 -0
  792. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbortSignal.js +249 -0
  793. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AbstractRange.js +171 -0
  794. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js +53 -0
  795. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/AssignedNodesOptions.js +28 -0
  796. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Attr.js +217 -0
  797. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BarProp.js +117 -0
  798. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BeforeUnloadEvent.js +139 -0
  799. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BinaryType.js +12 -0
  800. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Blob.js +211 -0
  801. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobCallback.js +30 -0
  802. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobEvent.js +157 -0
  803. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobEventInit.js +43 -0
  804. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/BlobPropertyBag.js +42 -0
  805. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CDATASection.js +109 -0
  806. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CanPlayTypeResult.js +12 -0
  807. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CharacterData.js +453 -0
  808. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CloseEvent.js +168 -0
  809. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CloseEventInit.js +65 -0
  810. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Comment.js +120 -0
  811. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CompositionEvent.js +219 -0
  812. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CompositionEventInit.js +32 -0
  813. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Crypto.js +148 -0
  814. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomElementConstructor.js +34 -0
  815. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomElementRegistry.js +267 -0
  816. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomEvent.js +206 -0
  817. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/CustomEventInit.js +32 -0
  818. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMException.js +222 -0
  819. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMImplementation.js +237 -0
  820. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMParser.js +140 -0
  821. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRect.js +276 -0
  822. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRectInit.js +76 -0
  823. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMRectReadOnly.js +285 -0
  824. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMStringMap.js +297 -0
  825. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DOMTokenList.js +537 -0
  826. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEvent.js +183 -0
  827. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventAcceleration.js +145 -0
  828. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventAccelerationInit.js +61 -0
  829. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventInit.js +70 -0
  830. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventRotationRate.js +145 -0
  831. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceMotionEventRotationRateInit.js +61 -0
  832. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceOrientationEvent.js +183 -0
  833. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DeviceOrientationEventInit.js +80 -0
  834. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Document.js +4509 -0
  835. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentFragment.js +334 -0
  836. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentReadyState.js +12 -0
  837. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/DocumentType.js +252 -0
  838. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Element.js +3718 -0
  839. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementCreationOptions.js +26 -0
  840. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementDefinitionOptions.js +29 -0
  841. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ElementInternals.js +2150 -0
  842. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EndingType.js +12 -0
  843. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ErrorEvent.js +192 -0
  844. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ErrorEventInit.js +92 -0
  845. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Event.js +430 -0
  846. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js +36 -0
  847. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventInit.js +58 -0
  848. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventListener.js +35 -0
  849. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventListenerOptions.js +28 -0
  850. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventModifierInit.js +221 -0
  851. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js +259 -0
  852. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/External.js +130 -0
  853. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/File.js +185 -0
  854. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FileList.js +298 -0
  855. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FilePropertyBag.js +33 -0
  856. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FileReader.js +468 -0
  857. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FocusEvent.js +144 -0
  858. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FocusEventInit.js +36 -0
  859. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/FormData.js +468 -0
  860. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Function.js +42 -0
  861. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/GetRootNodeOptions.js +31 -0
  862. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js +1023 -0
  863. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAreaElement.js +822 -0
  864. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLAudioElement.js +110 -0
  865. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBRElement.js +153 -0
  866. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBaseElement.js +193 -0
  867. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLBodyElement.js +877 -0
  868. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLButtonElement.js +522 -0
  869. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js +304 -0
  870. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLCollection.js +352 -0
  871. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js +156 -0
  872. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataElement.js +153 -0
  873. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDataListElement.js +125 -0
  874. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDetailsElement.js +156 -0
  875. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDialogElement.js +156 -0
  876. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js +156 -0
  877. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLDivElement.js +153 -0
  878. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js +3489 -0
  879. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js +378 -0
  880. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js +329 -0
  881. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFontElement.js +236 -0
  882. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormControlsCollection.js +318 -0
  883. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js +658 -0
  884. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameElement.js +510 -0
  885. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js +708 -0
  886. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHRElement.js +320 -0
  887. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadElement.js +110 -0
  888. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js +153 -0
  889. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js +153 -0
  890. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js +686 -0
  891. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLImageElement.js +902 -0
  892. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLInputElement.js +1927 -0
  893. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLIElement.js +201 -0
  894. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLabelElement.js +179 -0
  895. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLegendElement.js +166 -0
  896. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLLinkElement.js +552 -0
  897. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMapElement.js +168 -0
  898. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMarqueeElement.js +554 -0
  899. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMediaElement.js +898 -0
  900. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMenuElement.js +156 -0
  901. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMetaElement.js +276 -0
  902. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js +365 -0
  903. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLModElement.js +214 -0
  904. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOListElement.js +281 -0
  905. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js +941 -0
  906. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js +197 -0
  907. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionElement.js +376 -0
  908. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOptionsCollection.js +511 -0
  909. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLOutputElement.js +392 -0
  910. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js +153 -0
  911. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLParamElement.js +276 -0
  912. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLPictureElement.js +110 -0
  913. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLPreElement.js +160 -0
  914. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLProgressElement.js +228 -0
  915. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js +173 -0
  916. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLScriptElement.js +469 -0
  917. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSelectElement.js +989 -0
  918. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSlotElement.js +192 -0
  919. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSourceElement.js +337 -0
  920. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLSpanElement.js +110 -0
  921. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLStyleElement.js +207 -0
  922. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js +153 -0
  923. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js +729 -0
  924. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableColElement.js +372 -0
  925. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js +799 -0
  926. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js +414 -0
  927. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js +346 -0
  928. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js +123 -0
  929. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js +1206 -0
  930. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTimeElement.js +153 -0
  931. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTitleElement.js +152 -0
  932. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLTrackElement.js +363 -0
  933. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLUListElement.js +197 -0
  934. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js +109 -0
  935. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HTMLVideoElement.js +340 -0
  936. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEvent.js +157 -0
  937. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/HashChangeEventInit.js +50 -0
  938. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Headers.js +418 -0
  939. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/History.js +266 -0
  940. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js +168 -0
  941. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js +68 -0
  942. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEvent.js +445 -0
  943. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/KeyboardEventInit.js +116 -0
  944. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Location.js +404 -0
  945. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MessageEvent.js +317 -0
  946. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MessageEventInit.js +100 -0
  947. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MimeType.js +156 -0
  948. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MimeTypeArray.js +326 -0
  949. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MouseEvent.js +595 -0
  950. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MouseEventInit.js +189 -0
  951. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationCallback.js +34 -0
  952. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationObserver.js +178 -0
  953. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationObserverInit.js +121 -0
  954. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/MutationRecord.js +229 -0
  955. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NamedNodeMap.js +527 -0
  956. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Navigator.js +326 -0
  957. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Node.js +763 -0
  958. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeFilter.js +75 -0
  959. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeIterator.js +207 -0
  960. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/NodeList.js +302 -0
  961. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/OnBeforeUnloadEventHandlerNonNull.js +42 -0
  962. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js +56 -0
  963. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js +144 -0
  964. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js +35 -0
  965. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Performance.js +142 -0
  966. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Plugin.js +359 -0
  967. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js +336 -0
  968. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PointerEvent.js +324 -0
  969. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PointerEventInit.js +241 -0
  970. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js +144 -0
  971. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js +32 -0
  972. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js +122 -0
  973. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js +170 -0
  974. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js +65 -0
  975. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEvent.js +157 -0
  976. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEventInit.js +42 -0
  977. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/RadioNodeList.js +296 -0
  978. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Range.js +641 -0
  979. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedPreserveAspectRatio.js +136 -0
  980. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedRect.js +136 -0
  981. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js +149 -0
  982. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js +64 -0
  983. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGDefsElement.js +109 -0
  984. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGDescElement.js +109 -0
  985. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js +3155 -0
  986. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGGElement.js +109 -0
  987. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js +139 -0
  988. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGMetadataElement.js +109 -0
  989. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js +132 -0
  990. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGPreserveAspectRatio.js +196 -0
  991. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGRect.js +210 -0
  992. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js +786 -0
  993. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js +511 -0
  994. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSwitchElement.js +109 -0
  995. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGSymbolElement.js +146 -0
  996. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js +109 -0
  997. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Screen.js +180 -0
  998. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollBehavior.js +12 -0
  999. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js +45 -0
  1000. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js +14 -0
  1001. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js +30 -0
  1002. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ScrollRestoration.js +12 -0
  1003. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Selection.js +569 -0
  1004. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js +12 -0
  1005. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js +187 -0
  1006. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js +30 -0
  1007. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js +12 -0
  1008. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js +123 -0
  1009. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js +72 -0
  1010. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Storage.js +397 -0
  1011. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StorageEvent.js +318 -0
  1012. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StorageEventInit.js +99 -0
  1013. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/StyleSheetList.js +300 -0
  1014. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SubmitEvent.js +144 -0
  1015. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SubmitEventInit.js +36 -0
  1016. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/SupportedType.js +18 -0
  1017. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/Text.js +170 -0
  1018. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TextTrackKind.js +12 -0
  1019. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TouchEvent.js +222 -0
  1020. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TouchEventInit.js +89 -0
  1021. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TransitionEvent.js +170 -0
  1022. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TransitionEventInit.js +65 -0
  1023. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/TreeWalker.js +255 -0
  1024. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/UIEvent.js +235 -0
  1025. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/UIEventInit.js +62 -0
  1026. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/ValidityState.js +249 -0
  1027. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/VisibilityState.js +12 -0
  1028. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/VoidFunction.js +26 -0
  1029. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WebSocket.js +480 -0
  1030. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WheelEvent.js +191 -0
  1031. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/WheelEventInit.js +71 -0
  1032. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLDocument.js +109 -0
  1033. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequest.js +663 -0
  1034. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestEventTarget.js +334 -0
  1035. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestResponseType.js +14 -0
  1036. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLHttpRequestUpload.js +109 -0
  1037. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/XMLSerializer.js +132 -0
  1038. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/generated/utils.js +252 -0
  1039. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/geometry/DOMRect-impl.js +39 -0
  1040. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/geometry/DOMRectReadOnly-impl.js +72 -0
  1041. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/agent-factory.js +13 -0
  1042. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/binary-data.js +9 -0
  1043. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/colors.js +245 -0
  1044. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/create-element.js +329 -0
  1045. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js +188 -0
  1046. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/custom-elements.js +272 -0
  1047. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/dates-and-times.js +270 -0
  1048. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/details.js +15 -0
  1049. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/events.js +24 -0
  1050. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/focusing.js +104 -0
  1051. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/form-controls.js +309 -0
  1052. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/html-constructor.js +78 -0
  1053. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js +266 -0
  1054. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/internal-constants.js +12 -0
  1055. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/is-window.js +18 -0
  1056. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/iterable-weak-set.js +48 -0
  1057. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/json.js +12 -0
  1058. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/mutation-observers.js +198 -0
  1059. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/namespaces.js +16 -0
  1060. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/node.js +68 -0
  1061. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/number-and-date-inputs.js +195 -0
  1062. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/ordered-set.js +104 -0
  1063. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/page-transition-event.js +9 -0
  1064. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js +75 -0
  1065. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/shadow-dom.js +285 -0
  1066. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/strings.js +162 -0
  1067. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/style-rules.js +319 -0
  1068. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/stylesheets.js +129 -0
  1069. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/svg/basic-types.js +41 -0
  1070. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/svg/render.js +46 -0
  1071. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/system-colors.js +147 -0
  1072. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/text.js +19 -0
  1073. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/traversal.js +72 -0
  1074. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/helpers/validate-names.js +65 -0
  1075. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/hr-time/Performance-impl.js +22 -0
  1076. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/interfaces.js +249 -0
  1077. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationObserver-impl.js +95 -0
  1078. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/mutation-observer/MutationRecord-impl.js +37 -0
  1079. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/MimeType-impl.js +3 -0
  1080. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/MimeTypeArray-impl.js +21 -0
  1081. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/Navigator-impl.js +29 -0
  1082. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js +8 -0
  1083. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js +7 -0
  1084. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js +37 -0
  1085. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js +9 -0
  1086. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js +7 -0
  1087. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js +8 -0
  1088. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/Plugin-impl.js +3 -0
  1089. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/navigator/PluginArray-impl.js +23 -0
  1090. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node-document-position.js +10 -0
  1091. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node-type.js +16 -0
  1092. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/node.js +331 -0
  1093. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/CDATASection-impl.js +16 -0
  1094. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/CharacterData-impl.js +118 -0
  1095. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ChildNode-impl.js +80 -0
  1096. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Comment-impl.js +20 -0
  1097. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js +120 -0
  1098. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMStringMap-impl.js +64 -0
  1099. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DOMTokenList-impl.js +171 -0
  1100. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js +1014 -0
  1101. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js +44 -0
  1102. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentOrShadowRoot-impl.js +28 -0
  1103. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/DocumentType-impl.js +24 -0
  1104. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Element-impl.js +608 -0
  1105. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js +22 -0
  1106. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js +7 -0
  1107. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js +157 -0
  1108. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js +50 -0
  1109. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js +43 -0
  1110. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js +9 -0
  1111. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js +9 -0
  1112. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js +44 -0
  1113. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js +17 -0
  1114. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js +79 -0
  1115. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js +136 -0
  1116. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCollection-impl.js +96 -0
  1117. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js +9 -0
  1118. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js +9 -0
  1119. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js +20 -0
  1120. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDetailsElement-impl.js +35 -0
  1121. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js +9 -0
  1122. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js +9 -0
  1123. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js +9 -0
  1124. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js +211 -0
  1125. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js +8 -0
  1126. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js +43 -0
  1127. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js +9 -0
  1128. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormControlsCollection-impl.js +33 -0
  1129. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js +248 -0
  1130. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js +266 -0
  1131. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js +17 -0
  1132. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js +9 -0
  1133. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js +9 -0
  1134. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js +9 -0
  1135. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js +9 -0
  1136. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js +366 -0
  1137. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js +9 -0
  1138. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js +131 -0
  1139. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js +1097 -0
  1140. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js +9 -0
  1141. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js +94 -0
  1142. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js +18 -0
  1143. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js +107 -0
  1144. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js +13 -0
  1145. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMarqueeElement-impl.js +9 -0
  1146. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js +138 -0
  1147. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js +9 -0
  1148. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js +9 -0
  1149. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js +180 -0
  1150. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js +9 -0
  1151. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js +22 -0
  1152. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js +26 -0
  1153. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js +9 -0
  1154. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js +146 -0
  1155. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOptionsCollection-impl.js +110 -0
  1156. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js +88 -0
  1157. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js +88 -0
  1158. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js +9 -0
  1159. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js +9 -0
  1160. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPictureElement-impl.js +9 -0
  1161. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js +9 -0
  1162. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js +72 -0
  1163. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js +9 -0
  1164. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js +261 -0
  1165. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js +283 -0
  1166. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSlotElement-impl.js +59 -0
  1167. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js +8 -0
  1168. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js +9 -0
  1169. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js +73 -0
  1170. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js +9 -0
  1171. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js +73 -0
  1172. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js +9 -0
  1173. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js +236 -0
  1174. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js +88 -0
  1175. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js +61 -0
  1176. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js +67 -0
  1177. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js +244 -0
  1178. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js +9 -0
  1179. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js +18 -0
  1180. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js +13 -0
  1181. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js +9 -0
  1182. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js +9 -0
  1183. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js +17 -0
  1184. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js +2 -0
  1185. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Node-impl.js +1160 -0
  1186. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NodeList-impl.js +43 -0
  1187. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js +28 -0
  1188. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js +11 -0
  1189. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js +90 -0
  1190. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js +22 -0
  1191. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/RadioNodeList-impl.js +49 -0
  1192. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGDefsElement-impl.js +9 -0
  1193. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGDescElement-impl.js +9 -0
  1194. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGElement-impl.js +64 -0
  1195. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGGElement-impl.js +9 -0
  1196. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGGraphicsElement-impl.js +16 -0
  1197. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGMetadataElement-impl.js +9 -0
  1198. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSVGElement-impl.js +47 -0
  1199. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSwitchElement-impl.js +9 -0
  1200. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGSymbolElement-impl.js +9 -0
  1201. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGTests-impl.js +42 -0
  1202. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/SVGTitleElement-impl.js +9 -0
  1203. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/ShadowRoot-impl.js +41 -0
  1204. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Slotable-impl.js +48 -0
  1205. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/Text-impl.js +96 -0
  1206. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js +52 -0
  1207. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js +4 -0
  1208. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/AbstractRange-impl.js +43 -0
  1209. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/Range-impl.js +897 -0
  1210. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/StaticRange-impl.js +39 -0
  1211. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/range/boundary-point.js +47 -0
  1212. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/selection/Selection-impl.js +358 -0
  1213. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedPreserveAspectRatio-impl.js +24 -0
  1214. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedRect-impl.js +122 -0
  1215. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGAnimatedString-impl.js +42 -0
  1216. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGListBase.js +195 -0
  1217. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGNumber-impl.js +48 -0
  1218. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGPreserveAspectRatio-impl.js +100 -0
  1219. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGRect-impl.js +143 -0
  1220. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/svg/SVGStringList-impl.js +16 -0
  1221. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/NodeIterator-impl.js +107 -0
  1222. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js +217 -0
  1223. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/traversal/helpers.js +44 -0
  1224. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/webidl/DOMException-impl.js +46 -0
  1225. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/websockets/WebSocket-impl.js +328 -0
  1226. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/webstorage/Storage-impl.js +102 -0
  1227. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/BarProp-impl.js +10 -0
  1228. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/External-impl.js +9 -0
  1229. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/History-impl.js +148 -0
  1230. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js +227 -0
  1231. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/Screen-impl.js +13 -0
  1232. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/SessionHistory.js +163 -0
  1233. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window/navigation.js +85 -0
  1234. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/window-properties.js +241 -0
  1235. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/FormData-impl.js +191 -0
  1236. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js +1005 -0
  1237. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestEventTarget-impl.js +17 -0
  1238. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequestUpload-impl.js +4 -0
  1239. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/multipart-form-data.js +105 -0
  1240. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/xhr-sync-worker.js +59 -0
  1241. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js +410 -0
  1242. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/utils.js +105 -0
  1243. data/lib/readability_js/node/node_modules/jsdom/lib/jsdom/virtual-console.js +46 -0
  1244. data/lib/readability_js/node/node_modules/jsdom/package.json +93 -0
  1245. data/lib/readability_js/node/node_modules/lru-cache/LICENSE +15 -0
  1246. data/lib/readability_js/node/node_modules/lru-cache/README.md +338 -0
  1247. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.d.ts +1322 -0
  1248. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
  1249. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.js +1568 -0
  1250. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
  1251. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  1252. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
  1253. data/lib/readability_js/node/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  1254. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.d.ts +1322 -0
  1255. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
  1256. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.js +1564 -0
  1257. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.js.map +1 -0
  1258. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  1259. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
  1260. data/lib/readability_js/node/node_modules/lru-cache/dist/esm/package.json +3 -0
  1261. data/lib/readability_js/node/node_modules/lru-cache/package.json +113 -0
  1262. data/lib/readability_js/node/node_modules/mdn-data/LICENSE +116 -0
  1263. data/lib/readability_js/node/node_modules/mdn-data/README.md +59 -0
  1264. data/lib/readability_js/node/node_modules/mdn-data/api/index.js +3 -0
  1265. data/lib/readability_js/node/node_modules/mdn-data/api/inheritance.json +2681 -0
  1266. data/lib/readability_js/node/node_modules/mdn-data/api/inheritance.schema.json +31 -0
  1267. data/lib/readability_js/node/node_modules/mdn-data/css/at-rules.json +504 -0
  1268. data/lib/readability_js/node/node_modules/mdn-data/css/at-rules.schema.json +131 -0
  1269. data/lib/readability_js/node/node_modules/mdn-data/css/definitions.json +80 -0
  1270. data/lib/readability_js/node/node_modules/mdn-data/css/functions.json +593 -0
  1271. data/lib/readability_js/node/node_modules/mdn-data/css/functions.schema.json +45 -0
  1272. data/lib/readability_js/node/node_modules/mdn-data/css/index.js +9 -0
  1273. data/lib/readability_js/node/node_modules/mdn-data/css/properties.json +10806 -0
  1274. data/lib/readability_js/node/node_modules/mdn-data/css/properties.schema.json +449 -0
  1275. data/lib/readability_js/node/node_modules/mdn-data/css/selectors.json +1071 -0
  1276. data/lib/readability_js/node/node_modules/mdn-data/css/selectors.schema.json +36 -0
  1277. data/lib/readability_js/node/node_modules/mdn-data/css/syntaxes.json +899 -0
  1278. data/lib/readability_js/node/node_modules/mdn-data/css/syntaxes.schema.json +15 -0
  1279. data/lib/readability_js/node/node_modules/mdn-data/css/types.json +287 -0
  1280. data/lib/readability_js/node/node_modules/mdn-data/css/types.schema.json +32 -0
  1281. data/lib/readability_js/node/node_modules/mdn-data/css/units.json +213 -0
  1282. data/lib/readability_js/node/node_modules/mdn-data/css/units.schema.json +28 -0
  1283. data/lib/readability_js/node/node_modules/mdn-data/index.js +5 -0
  1284. data/lib/readability_js/node/node_modules/mdn-data/l10n/css.json +1876 -0
  1285. data/lib/readability_js/node/node_modules/mdn-data/l10n/index.js +3 -0
  1286. data/lib/readability_js/node/node_modules/mdn-data/package.json +38 -0
  1287. data/lib/readability_js/node/node_modules/ms/index.js +162 -0
  1288. data/lib/readability_js/node/node_modules/ms/license.md +21 -0
  1289. data/lib/readability_js/node/node_modules/ms/package.json +38 -0
  1290. data/lib/readability_js/node/node_modules/ms/readme.md +59 -0
  1291. data/lib/readability_js/node/node_modules/parse5/LICENSE +19 -0
  1292. data/lib/readability_js/node/node_modules/parse5/README.md +38 -0
  1293. data/lib/readability_js/node/node_modules/parse5/dist/common/doctype.d.ts +4 -0
  1294. data/lib/readability_js/node/node_modules/parse5/dist/common/doctype.js +114 -0
  1295. data/lib/readability_js/node/node_modules/parse5/dist/common/error-codes.d.ts +67 -0
  1296. data/lib/readability_js/node/node_modules/parse5/dist/common/error-codes.js +63 -0
  1297. data/lib/readability_js/node/node_modules/parse5/dist/common/foreign-content.d.ts +9 -0
  1298. data/lib/readability_js/node/node_modules/parse5/dist/common/foreign-content.js +228 -0
  1299. data/lib/readability_js/node/node_modules/parse5/dist/common/html.d.ts +289 -0
  1300. data/lib/readability_js/node/node_modules/parse5/dist/common/html.js +523 -0
  1301. data/lib/readability_js/node/node_modules/parse5/dist/common/token.d.ts +84 -0
  1302. data/lib/readability_js/node/node_modules/parse5/dist/common/token.js +20 -0
  1303. data/lib/readability_js/node/node_modules/parse5/dist/common/unicode.d.ts +42 -0
  1304. data/lib/readability_js/node/node_modules/parse5/dist/common/unicode.js +62 -0
  1305. data/lib/readability_js/node/node_modules/parse5/dist/index.d.ts +71 -0
  1306. data/lib/readability_js/node/node_modules/parse5/dist/index.js +42 -0
  1307. data/lib/readability_js/node/node_modules/parse5/dist/parser/formatting-element-list.d.ts +36 -0
  1308. data/lib/readability_js/node/node_modules/parse5/dist/parser/formatting-element-list.js +110 -0
  1309. data/lib/readability_js/node/node_modules/parse5/dist/parser/index.d.ts +221 -0
  1310. data/lib/readability_js/node/node_modules/parse5/dist/parser/index.js +3245 -0
  1311. data/lib/readability_js/node/node_modules/parse5/dist/parser/open-element-stack.d.ts +53 -0
  1312. data/lib/readability_js/node/node_modules/parse5/dist/parser/open-element-stack.js +324 -0
  1313. data/lib/readability_js/node/node_modules/parse5/dist/serializer/index.d.ts +60 -0
  1314. data/lib/readability_js/node/node_modules/parse5/dist/serializer/index.js +168 -0
  1315. data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/index.d.ts +247 -0
  1316. data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/index.js +2710 -0
  1317. data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +36 -0
  1318. data/lib/readability_js/node/node_modules/parse5/dist/tokenizer/preprocessor.js +196 -0
  1319. data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/default.d.ts +84 -0
  1320. data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/default.js +173 -0
  1321. data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/interface.d.ts +255 -0
  1322. data/lib/readability_js/node/node_modules/parse5/dist/tree-adapters/interface.js +1 -0
  1323. data/lib/readability_js/node/node_modules/parse5/package.json +48 -0
  1324. data/lib/readability_js/node/node_modules/punycode/LICENSE-MIT.txt +20 -0
  1325. data/lib/readability_js/node/node_modules/punycode/README.md +148 -0
  1326. data/lib/readability_js/node/node_modules/punycode/package.json +58 -0
  1327. data/lib/readability_js/node/node_modules/punycode/punycode.es6.js +444 -0
  1328. data/lib/readability_js/node/node_modules/punycode/punycode.js +443 -0
  1329. data/lib/readability_js/node/node_modules/require-from-string/index.js +34 -0
  1330. data/lib/readability_js/node/node_modules/require-from-string/license +21 -0
  1331. data/lib/readability_js/node/node_modules/require-from-string/package.json +28 -0
  1332. data/lib/readability_js/node/node_modules/require-from-string/readme.md +56 -0
  1333. data/lib/readability_js/node/node_modules/rrweb-cssom/LICENSE.txt +20 -0
  1334. data/lib/readability_js/node/node_modules/rrweb-cssom/README.mdown +74 -0
  1335. data/lib/readability_js/node/node_modules/rrweb-cssom/build/CSSOM.js +1995 -0
  1336. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSConditionRule.js +25 -0
  1337. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSContainerRule.js +50 -0
  1338. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSDocumentRule.js +39 -0
  1339. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSFontFaceRule.js +36 -0
  1340. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSGroupingRule.js +69 -0
  1341. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSHostRule.js +37 -0
  1342. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSImportRule.js +132 -0
  1343. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSKeyframeRule.js +37 -0
  1344. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSKeyframesRule.js +39 -0
  1345. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSLayerBlockRule.js +48 -0
  1346. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSMediaRule.js +53 -0
  1347. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSOM.js +3 -0
  1348. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSRule.js +42 -0
  1349. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStartingStyleRule.js +37 -0
  1350. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleDeclaration.js +148 -0
  1351. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleRule.js +190 -0
  1352. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSStyleSheet.js +88 -0
  1353. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSSupportsRule.js +36 -0
  1354. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSValue.js +43 -0
  1355. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/CSSValueExpression.js +344 -0
  1356. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/MatcherList.js +62 -0
  1357. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/MediaList.js +61 -0
  1358. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/StyleSheet.js +17 -0
  1359. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/clone.js +80 -0
  1360. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/index.js +26 -0
  1361. data/lib/readability_js/node/node_modules/rrweb-cssom/lib/parse.js +525 -0
  1362. data/lib/readability_js/node/node_modules/rrweb-cssom/package.json +27 -0
  1363. data/lib/readability_js/node/node_modules/safer-buffer/LICENSE +21 -0
  1364. data/lib/readability_js/node/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  1365. data/lib/readability_js/node/node_modules/safer-buffer/Readme.md +156 -0
  1366. data/lib/readability_js/node/node_modules/safer-buffer/dangerous.js +58 -0
  1367. data/lib/readability_js/node/node_modules/safer-buffer/package.json +34 -0
  1368. data/lib/readability_js/node/node_modules/safer-buffer/safer.js +77 -0
  1369. data/lib/readability_js/node/node_modules/safer-buffer/tests.js +406 -0
  1370. data/lib/readability_js/node/node_modules/saxes/README.md +323 -0
  1371. data/lib/readability_js/node/node_modules/saxes/package.json +71 -0
  1372. data/lib/readability_js/node/node_modules/saxes/saxes.d.ts +635 -0
  1373. data/lib/readability_js/node/node_modules/saxes/saxes.js +2053 -0
  1374. data/lib/readability_js/node/node_modules/saxes/saxes.js.map +1 -0
  1375. data/lib/readability_js/node/node_modules/source-map-js/LICENSE +28 -0
  1376. data/lib/readability_js/node/node_modules/source-map-js/README.md +765 -0
  1377. data/lib/readability_js/node/node_modules/source-map-js/lib/array-set.js +121 -0
  1378. data/lib/readability_js/node/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  1379. data/lib/readability_js/node/node_modules/source-map-js/lib/base64.js +67 -0
  1380. data/lib/readability_js/node/node_modules/source-map-js/lib/binary-search.js +111 -0
  1381. data/lib/readability_js/node/node_modules/source-map-js/lib/mapping-list.js +79 -0
  1382. data/lib/readability_js/node/node_modules/source-map-js/lib/quick-sort.js +132 -0
  1383. data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  1384. data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  1385. data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  1386. data/lib/readability_js/node/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  1387. data/lib/readability_js/node/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  1388. data/lib/readability_js/node/node_modules/source-map-js/lib/source-node.js +413 -0
  1389. data/lib/readability_js/node/node_modules/source-map-js/lib/util.js +594 -0
  1390. data/lib/readability_js/node/node_modules/source-map-js/package.json +71 -0
  1391. data/lib/readability_js/node/node_modules/source-map-js/source-map.d.ts +104 -0
  1392. data/lib/readability_js/node/node_modules/source-map-js/source-map.js +8 -0
  1393. data/lib/readability_js/node/node_modules/symbol-tree/LICENSE +21 -0
  1394. data/lib/readability_js/node/node_modules/symbol-tree/README.md +545 -0
  1395. data/lib/readability_js/node/node_modules/symbol-tree/lib/SymbolTree.js +838 -0
  1396. data/lib/readability_js/node/node_modules/symbol-tree/lib/SymbolTreeNode.js +54 -0
  1397. data/lib/readability_js/node/node_modules/symbol-tree/lib/TreeIterator.js +69 -0
  1398. data/lib/readability_js/node/node_modules/symbol-tree/lib/TreePosition.js +11 -0
  1399. data/lib/readability_js/node/node_modules/symbol-tree/package.json +47 -0
  1400. data/lib/readability_js/node/node_modules/tldts/LICENSE +13 -0
  1401. data/lib/readability_js/node/node_modules/tldts/README.md +327 -0
  1402. data/lib/readability_js/node/node_modules/tldts/bin/cli.js +21 -0
  1403. data/lib/readability_js/node/node_modules/tldts/dist/cjs/index.js +669 -0
  1404. data/lib/readability_js/node/node_modules/tldts/dist/cjs/index.js.map +1 -0
  1405. data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/data/trie.js +14 -0
  1406. data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/data/trie.js.map +1 -0
  1407. data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/suffix-trie.js +67 -0
  1408. data/lib/readability_js/node/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +1 -0
  1409. data/lib/readability_js/node/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +1 -0
  1410. data/lib/readability_js/node/node_modules/tldts/dist/es6/index.js +33 -0
  1411. data/lib/readability_js/node/node_modules/tldts/dist/es6/index.js.map +1 -0
  1412. data/lib/readability_js/node/node_modules/tldts/dist/es6/src/data/trie.js +11 -0
  1413. data/lib/readability_js/node/node_modules/tldts/dist/es6/src/data/trie.js.map +1 -0
  1414. data/lib/readability_js/node/node_modules/tldts/dist/es6/src/suffix-trie.js +64 -0
  1415. data/lib/readability_js/node/node_modules/tldts/dist/es6/src/suffix-trie.js.map +1 -0
  1416. data/lib/readability_js/node/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
  1417. data/lib/readability_js/node/node_modules/tldts/dist/index.cjs.min.js +2 -0
  1418. data/lib/readability_js/node/node_modules/tldts/dist/index.cjs.min.js.map +1 -0
  1419. data/lib/readability_js/node/node_modules/tldts/dist/index.esm.min.js +2 -0
  1420. data/lib/readability_js/node/node_modules/tldts/dist/index.esm.min.js.map +1 -0
  1421. data/lib/readability_js/node/node_modules/tldts/dist/index.umd.min.js +2 -0
  1422. data/lib/readability_js/node/node_modules/tldts/dist/index.umd.min.js.map +1 -0
  1423. data/lib/readability_js/node/node_modules/tldts/dist/types/index.d.ts +7 -0
  1424. data/lib/readability_js/node/node_modules/tldts/dist/types/src/data/trie.d.ts +5 -0
  1425. data/lib/readability_js/node/node_modules/tldts/dist/types/src/suffix-trie.d.ts +5 -0
  1426. data/lib/readability_js/node/node_modules/tldts/index.ts +62 -0
  1427. data/lib/readability_js/node/node_modules/tldts/package.json +91 -0
  1428. data/lib/readability_js/node/node_modules/tldts/src/data/trie.ts +14 -0
  1429. data/lib/readability_js/node/node_modules/tldts/src/suffix-trie.ts +110 -0
  1430. data/lib/readability_js/node/node_modules/tldts-core/LICENSE +13 -0
  1431. data/lib/readability_js/node/node_modules/tldts-core/README.md +3 -0
  1432. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/index.js +564 -0
  1433. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/index.js.map +1 -0
  1434. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +15 -0
  1435. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +1 -0
  1436. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain.js +83 -0
  1437. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/domain.js.map +1 -0
  1438. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +149 -0
  1439. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +1 -0
  1440. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/factory.js +107 -0
  1441. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/factory.js.map +1 -0
  1442. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-ip.js +72 -0
  1443. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +1 -0
  1444. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-valid.js +69 -0
  1445. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +1 -0
  1446. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +69 -0
  1447. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +1 -0
  1448. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +3 -0
  1449. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +1 -0
  1450. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/options.js +22 -0
  1451. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/options.js.map +1 -0
  1452. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/subdomain.js +14 -0
  1453. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +1 -0
  1454. data/lib/readability_js/node/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +1 -0
  1455. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/index.js +4 -0
  1456. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/index.js.map +1 -0
  1457. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +12 -0
  1458. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +1 -0
  1459. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain.js +80 -0
  1460. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/domain.js.map +1 -0
  1461. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/extract-hostname.js +146 -0
  1462. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +1 -0
  1463. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/factory.js +102 -0
  1464. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/factory.js.map +1 -0
  1465. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-ip.js +69 -0
  1466. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-ip.js.map +1 -0
  1467. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-valid.js +66 -0
  1468. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/is-valid.js.map +1 -0
  1469. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +66 -0
  1470. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +1 -0
  1471. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/interface.js +2 -0
  1472. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +1 -0
  1473. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/options.js +19 -0
  1474. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/options.js.map +1 -0
  1475. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/subdomain.js +11 -0
  1476. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/src/subdomain.js.map +1 -0
  1477. data/lib/readability_js/node/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
  1478. data/lib/readability_js/node/node_modules/tldts-core/dist/types/index.d.ts +4 -0
  1479. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +6 -0
  1480. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/domain.d.ts +5 -0
  1481. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +5 -0
  1482. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/factory.d.ts +28 -0
  1483. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/is-ip.d.ts +6 -0
  1484. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/is-valid.d.ts +15 -0
  1485. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +2 -0
  1486. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +9 -0
  1487. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/options.d.ts +10 -0
  1488. data/lib/readability_js/node/node_modules/tldts-core/dist/types/src/subdomain.d.ts +4 -0
  1489. data/lib/readability_js/node/node_modules/tldts-core/index.ts +10 -0
  1490. data/lib/readability_js/node/node_modules/tldts-core/package.json +68 -0
  1491. data/lib/readability_js/node/node_modules/tldts-core/src/domain-without-suffix.ts +14 -0
  1492. data/lib/readability_js/node/node_modules/tldts-core/src/domain.ts +100 -0
  1493. data/lib/readability_js/node/node_modules/tldts-core/src/extract-hostname.ts +170 -0
  1494. data/lib/readability_js/node/node_modules/tldts-core/src/factory.ts +163 -0
  1495. data/lib/readability_js/node/node_modules/tldts-core/src/is-ip.ts +87 -0
  1496. data/lib/readability_js/node/node_modules/tldts-core/src/is-valid.ts +79 -0
  1497. data/lib/readability_js/node/node_modules/tldts-core/src/lookup/fast-path.ts +80 -0
  1498. data/lib/readability_js/node/node_modules/tldts-core/src/lookup/interface.ts +10 -0
  1499. data/lib/readability_js/node/node_modules/tldts-core/src/options.ts +39 -0
  1500. data/lib/readability_js/node/node_modules/tldts-core/src/subdomain.ts +11 -0
  1501. data/lib/readability_js/node/node_modules/tough-cookie/LICENSE +12 -0
  1502. data/lib/readability_js/node/node_modules/tough-cookie/README.md +195 -0
  1503. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.cjs +2313 -0
  1504. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.cjs.map +1 -0
  1505. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.d.cts +1879 -0
  1506. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.d.ts +1879 -0
  1507. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.js +2268 -0
  1508. data/lib/readability_js/node/node_modules/tough-cookie/dist/index.js.map +1 -0
  1509. data/lib/readability_js/node/node_modules/tough-cookie/node_modules/.bin/tldts +1 -0
  1510. data/lib/readability_js/node/node_modules/tough-cookie/package.json +149 -0
  1511. data/lib/readability_js/node/node_modules/tr46/LICENSE.md +21 -0
  1512. data/lib/readability_js/node/node_modules/tr46/README.md +76 -0
  1513. data/lib/readability_js/node/node_modules/tr46/index.js +344 -0
  1514. data/lib/readability_js/node/node_modules/tr46/lib/mappingTable.json +1 -0
  1515. data/lib/readability_js/node/node_modules/tr46/lib/regexes.js +29 -0
  1516. data/lib/readability_js/node/node_modules/tr46/lib/statusMapping.js +9 -0
  1517. data/lib/readability_js/node/node_modules/tr46/package.json +47 -0
  1518. data/lib/readability_js/node/node_modules/w3c-xmlserializer/LICENSE.md +25 -0
  1519. data/lib/readability_js/node/node_modules/w3c-xmlserializer/README.md +41 -0
  1520. data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/attributes.js +125 -0
  1521. data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/constants.js +44 -0
  1522. data/lib/readability_js/node/node_modules/w3c-xmlserializer/lib/serialize.js +365 -0
  1523. data/lib/readability_js/node/node_modules/w3c-xmlserializer/package.json +32 -0
  1524. data/lib/readability_js/node/node_modules/webidl-conversions/LICENSE.md +12 -0
  1525. data/lib/readability_js/node/node_modules/webidl-conversions/README.md +99 -0
  1526. data/lib/readability_js/node/node_modules/webidl-conversions/lib/index.js +462 -0
  1527. data/lib/readability_js/node/node_modules/webidl-conversions/package.json +34 -0
  1528. data/lib/readability_js/node/node_modules/whatwg-encoding/LICENSE.txt +7 -0
  1529. data/lib/readability_js/node/node_modules/whatwg-encoding/README.md +50 -0
  1530. data/lib/readability_js/node/node_modules/whatwg-encoding/lib/labels-to-names.json +217 -0
  1531. data/lib/readability_js/node/node_modules/whatwg-encoding/lib/supported-names.json +38 -0
  1532. data/lib/readability_js/node/node_modules/whatwg-encoding/lib/whatwg-encoding.js +60 -0
  1533. data/lib/readability_js/node/node_modules/whatwg-encoding/package.json +32 -0
  1534. data/lib/readability_js/node/node_modules/whatwg-mimetype/LICENSE.txt +7 -0
  1535. data/lib/readability_js/node/node_modules/whatwg-mimetype/README.md +101 -0
  1536. data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/mime-type-parameters.js +70 -0
  1537. data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/mime-type.js +127 -0
  1538. data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/parser.js +105 -0
  1539. data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/serializer.js +25 -0
  1540. data/lib/readability_js/node/node_modules/whatwg-mimetype/lib/utils.js +60 -0
  1541. data/lib/readability_js/node/node_modules/whatwg-mimetype/package.json +45 -0
  1542. data/lib/readability_js/node/node_modules/whatwg-url/LICENSE.txt +21 -0
  1543. data/lib/readability_js/node/node_modules/whatwg-url/README.md +106 -0
  1544. data/lib/readability_js/node/node_modules/whatwg-url/index.js +27 -0
  1545. data/lib/readability_js/node/node_modules/whatwg-url/lib/Function.js +42 -0
  1546. data/lib/readability_js/node/node_modules/whatwg-url/lib/URL-impl.js +233 -0
  1547. data/lib/readability_js/node/node_modules/whatwg-url/lib/URL.js +499 -0
  1548. data/lib/readability_js/node/node_modules/whatwg-url/lib/URLSearchParams-impl.js +135 -0
  1549. data/lib/readability_js/node/node_modules/whatwg-url/lib/URLSearchParams.js +505 -0
  1550. data/lib/readability_js/node/node_modules/whatwg-url/lib/VoidFunction.js +26 -0
  1551. data/lib/readability_js/node/node_modules/whatwg-url/lib/encoding.js +16 -0
  1552. data/lib/readability_js/node/node_modules/whatwg-url/lib/infra.js +26 -0
  1553. data/lib/readability_js/node/node_modules/whatwg-url/lib/percent-encoding.js +142 -0
  1554. data/lib/readability_js/node/node_modules/whatwg-url/lib/url-state-machine.js +1277 -0
  1555. data/lib/readability_js/node/node_modules/whatwg-url/lib/urlencoded.js +89 -0
  1556. data/lib/readability_js/node/node_modules/whatwg-url/lib/utils.js +240 -0
  1557. data/lib/readability_js/node/node_modules/whatwg-url/package.json +56 -0
  1558. data/lib/readability_js/node/node_modules/whatwg-url/webidl2js-wrapper.js +7 -0
  1559. data/lib/readability_js/node/node_modules/ws/LICENSE +20 -0
  1560. data/lib/readability_js/node/node_modules/ws/README.md +548 -0
  1561. data/lib/readability_js/node/node_modules/ws/browser.js +8 -0
  1562. data/lib/readability_js/node/node_modules/ws/index.js +13 -0
  1563. data/lib/readability_js/node/node_modules/ws/lib/buffer-util.js +131 -0
  1564. data/lib/readability_js/node/node_modules/ws/lib/constants.js +18 -0
  1565. data/lib/readability_js/node/node_modules/ws/lib/event-target.js +292 -0
  1566. data/lib/readability_js/node/node_modules/ws/lib/extension.js +203 -0
  1567. data/lib/readability_js/node/node_modules/ws/lib/limiter.js +55 -0
  1568. data/lib/readability_js/node/node_modules/ws/lib/permessage-deflate.js +528 -0
  1569. data/lib/readability_js/node/node_modules/ws/lib/receiver.js +706 -0
  1570. data/lib/readability_js/node/node_modules/ws/lib/sender.js +602 -0
  1571. data/lib/readability_js/node/node_modules/ws/lib/stream.js +161 -0
  1572. data/lib/readability_js/node/node_modules/ws/lib/subprotocol.js +62 -0
  1573. data/lib/readability_js/node/node_modules/ws/lib/validation.js +152 -0
  1574. data/lib/readability_js/node/node_modules/ws/lib/websocket-server.js +550 -0
  1575. data/lib/readability_js/node/node_modules/ws/lib/websocket.js +1388 -0
  1576. data/lib/readability_js/node/node_modules/ws/package.json +69 -0
  1577. data/lib/readability_js/node/node_modules/ws/wrapper.mjs +8 -0
  1578. data/lib/readability_js/node/node_modules/xml-name-validator/LICENSE.txt +176 -0
  1579. data/lib/readability_js/node/node_modules/xml-name-validator/README.md +35 -0
  1580. data/lib/readability_js/node/node_modules/xml-name-validator/lib/xml-name-validator.js +9 -0
  1581. data/lib/readability_js/node/node_modules/xml-name-validator/package.json +30 -0
  1582. data/lib/readability_js/node/node_modules/xmlchars/LICENSE +18 -0
  1583. data/lib/readability_js/node/node_modules/xmlchars/README.md +33 -0
  1584. data/lib/readability_js/node/node_modules/xmlchars/package.json +51 -0
  1585. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.d.ts +31 -0
  1586. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.js +44 -0
  1587. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed4.js.map +1 -0
  1588. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.d.ts +51 -0
  1589. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.js +105 -0
  1590. data/lib/readability_js/node/node_modules/xmlchars/xml/1.0/ed5.js.map +1 -0
  1591. data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.d.ts +73 -0
  1592. data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.js +145 -0
  1593. data/lib/readability_js/node/node_modules/xmlchars/xml/1.1/ed2.js.map +1 -0
  1594. data/lib/readability_js/node/node_modules/xmlchars/xmlchars.d.ts +170 -0
  1595. data/lib/readability_js/node/node_modules/xmlchars/xmlchars.js +191 -0
  1596. data/lib/readability_js/node/node_modules/xmlchars/xmlchars.js.map +1 -0
  1597. data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.d.ts +28 -0
  1598. data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.js +65 -0
  1599. data/lib/readability_js/node/node_modules/xmlchars/xmlns/1.0/ed3.js.map +1 -0
  1600. data/lib/readability_js/node/package.json +9 -0
  1601. data/lib/readability_js/node/readability-example.js +10 -0
  1602. data/lib/readability_js/node/yarn.lock +315 -0
  1603. data/lib/readability_js/nodo.rb +67 -0
  1604. data/lib/readability_js/version.rb +3 -0
  1605. data/lib/readability_js.rb +207 -0
  1606. data/readability_js.gemspec +47 -0
  1607. metadata +1775 -0
@@ -0,0 +1,2786 @@
1
+ /*
2
+ * Copyright (c) 2010 Arc90 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
+ * http://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
+ /*
18
+ * This code is heavily based on Arc90's readability.js (1.7.1) script
19
+ * available at: http://code.google.com/p/arc90labs-readability
20
+ */
21
+
22
+ /**
23
+ * Public constructor.
24
+ * @param {HTMLDocument} doc The document to parse.
25
+ * @param {Object} options The options object.
26
+ */
27
+ function Readability(doc, options) {
28
+ // In some older versions, people passed a URI as the first argument. Cope:
29
+ if (options && options.documentElement) {
30
+ doc = options;
31
+ options = arguments[2];
32
+ } else if (!doc || !doc.documentElement) {
33
+ throw new Error(
34
+ "First argument to Readability constructor should be a document object."
35
+ );
36
+ }
37
+ options = options || {};
38
+
39
+ this._doc = doc;
40
+ this._docJSDOMParser = this._doc.firstChild.__JSDOMParser__;
41
+ this._articleTitle = null;
42
+ this._articleByline = null;
43
+ this._articleDir = null;
44
+ this._articleSiteName = null;
45
+ this._attempts = [];
46
+ this._metadata = {};
47
+
48
+ // Configurable options
49
+ this._debug = !!options.debug;
50
+ this._maxElemsToParse =
51
+ options.maxElemsToParse || this.DEFAULT_MAX_ELEMS_TO_PARSE;
52
+ this._nbTopCandidates =
53
+ options.nbTopCandidates || this.DEFAULT_N_TOP_CANDIDATES;
54
+ this._charThreshold = options.charThreshold || this.DEFAULT_CHAR_THRESHOLD;
55
+ this._classesToPreserve = this.CLASSES_TO_PRESERVE.concat(
56
+ options.classesToPreserve || []
57
+ );
58
+ this._keepClasses = !!options.keepClasses;
59
+ this._serializer =
60
+ options.serializer ||
61
+ function (el) {
62
+ return el.innerHTML;
63
+ };
64
+ this._disableJSONLD = !!options.disableJSONLD;
65
+ this._allowedVideoRegex = options.allowedVideoRegex || this.REGEXPS.videos;
66
+ this._linkDensityModifier = options.linkDensityModifier || 0;
67
+
68
+ // Start with all flags set
69
+ this._flags =
70
+ this.FLAG_STRIP_UNLIKELYS |
71
+ this.FLAG_WEIGHT_CLASSES |
72
+ this.FLAG_CLEAN_CONDITIONALLY;
73
+
74
+ // Control whether log messages are sent to the console
75
+ if (this._debug) {
76
+ let logNode = function (node) {
77
+ if (node.nodeType == node.TEXT_NODE) {
78
+ return `${node.nodeName} ("${node.textContent}")`;
79
+ }
80
+ let attrPairs = Array.from(node.attributes || [], function (attr) {
81
+ return `${attr.name}="${attr.value}"`;
82
+ }).join(" ");
83
+ return `<${node.localName} ${attrPairs}>`;
84
+ };
85
+ this.log = function () {
86
+ if (typeof console !== "undefined") {
87
+ let args = Array.from(arguments, arg => {
88
+ if (arg && arg.nodeType == this.ELEMENT_NODE) {
89
+ return logNode(arg);
90
+ }
91
+ return arg;
92
+ });
93
+ args.unshift("Reader: (Readability)");
94
+ // eslint-disable-next-line no-console
95
+ console.log(...args);
96
+ } else if (typeof dump !== "undefined") {
97
+ /* global dump */
98
+ var msg = Array.prototype.map
99
+ .call(arguments, function (x) {
100
+ return x && x.nodeName ? logNode(x) : x;
101
+ })
102
+ .join(" ");
103
+ dump("Reader: (Readability) " + msg + "\n");
104
+ }
105
+ };
106
+ } else {
107
+ this.log = function () {};
108
+ }
109
+ }
110
+
111
+ Readability.prototype = {
112
+ FLAG_STRIP_UNLIKELYS: 0x1,
113
+ FLAG_WEIGHT_CLASSES: 0x2,
114
+ FLAG_CLEAN_CONDITIONALLY: 0x4,
115
+
116
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
117
+ ELEMENT_NODE: 1,
118
+ TEXT_NODE: 3,
119
+
120
+ // Max number of nodes supported by this parser. Default: 0 (no limit)
121
+ DEFAULT_MAX_ELEMS_TO_PARSE: 0,
122
+
123
+ // The number of top candidates to consider when analysing how
124
+ // tight the competition is among candidates.
125
+ DEFAULT_N_TOP_CANDIDATES: 5,
126
+
127
+ // Element tags to score by default.
128
+ DEFAULT_TAGS_TO_SCORE: "section,h2,h3,h4,h5,h6,p,td,pre"
129
+ .toUpperCase()
130
+ .split(","),
131
+
132
+ // The default number of chars an article must have in order to return a result
133
+ DEFAULT_CHAR_THRESHOLD: 500,
134
+
135
+ // All of the regular expressions in use within readability.
136
+ // Defined up here so we don't instantiate them repeatedly in loops.
137
+ REGEXPS: {
138
+ // NOTE: These two regular expressions are duplicated in
139
+ // Readability-readerable.js. Please keep both copies in sync.
140
+ unlikelyCandidates:
141
+ /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
142
+ okMaybeItsACandidate: /and|article|body|column|content|main|shadow/i,
143
+
144
+ positive:
145
+ /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,
146
+ negative:
147
+ /-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|footer|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|widget/i,
148
+ extraneous:
149
+ /print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,
150
+ byline: /byline|author|dateline|writtenby|p-author/i,
151
+ replaceFonts: /<(\/?)font[^>]*>/gi,
152
+ normalize: /\s{2,}/g,
153
+ videos:
154
+ /\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,
155
+ shareElements: /(\b|_)(share|sharedaddy)(\b|_)/i,
156
+ nextLink: /(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,
157
+ prevLink: /(prev|earl|old|new|<|«)/i,
158
+ tokenize: /\W+/g,
159
+ whitespace: /^\s*$/,
160
+ hasContent: /\S$/,
161
+ hashUrl: /^#.+/,
162
+ srcsetUrl: /(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g,
163
+ b64DataUrl: /^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i,
164
+ // Commas as used in Latin, Sindhi, Chinese and various other scripts.
165
+ // see: https://en.wikipedia.org/wiki/Comma#Comma_variants
166
+ commas: /\u002C|\u060C|\uFE50|\uFE10|\uFE11|\u2E41|\u2E34|\u2E32|\uFF0C/g,
167
+ // See: https://schema.org/Article
168
+ jsonLdArticleTypes:
169
+ /^Article|AdvertiserContentArticle|NewsArticle|AnalysisNewsArticle|AskPublicNewsArticle|BackgroundNewsArticle|OpinionNewsArticle|ReportageNewsArticle|ReviewNewsArticle|Report|SatiricalArticle|ScholarlyArticle|MedicalScholarlyArticle|SocialMediaPosting|BlogPosting|LiveBlogPosting|DiscussionForumPosting|TechArticle|APIReference$/,
170
+ // used to see if a node's content matches words commonly used for ad blocks or loading indicators
171
+ adWords:
172
+ /^(ad(vertising|vertisement)?|pub(licité)?|werb(ung)?|广告|Реклама|Anuncio)$/iu,
173
+ loadingWords:
174
+ /^((loading|正在加载|Загрузка|chargement|cargando)(…|\.\.\.)?)$/iu,
175
+ },
176
+
177
+ UNLIKELY_ROLES: [
178
+ "menu",
179
+ "menubar",
180
+ "complementary",
181
+ "navigation",
182
+ "alert",
183
+ "alertdialog",
184
+ "dialog",
185
+ ],
186
+
187
+ DIV_TO_P_ELEMS: new Set([
188
+ "BLOCKQUOTE",
189
+ "DL",
190
+ "DIV",
191
+ "IMG",
192
+ "OL",
193
+ "P",
194
+ "PRE",
195
+ "TABLE",
196
+ "UL",
197
+ ]),
198
+
199
+ ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P", "OL", "UL"],
200
+
201
+ PRESENTATIONAL_ATTRIBUTES: [
202
+ "align",
203
+ "background",
204
+ "bgcolor",
205
+ "border",
206
+ "cellpadding",
207
+ "cellspacing",
208
+ "frame",
209
+ "hspace",
210
+ "rules",
211
+ "style",
212
+ "valign",
213
+ "vspace",
214
+ ],
215
+
216
+ DEPRECATED_SIZE_ATTRIBUTE_ELEMS: ["TABLE", "TH", "TD", "HR", "PRE"],
217
+
218
+ // The commented out elements qualify as phrasing content but tend to be
219
+ // removed by readability when put into paragraphs, so we ignore them here.
220
+ PHRASING_ELEMS: [
221
+ // "CANVAS", "IFRAME", "SVG", "VIDEO",
222
+ "ABBR",
223
+ "AUDIO",
224
+ "B",
225
+ "BDO",
226
+ "BR",
227
+ "BUTTON",
228
+ "CITE",
229
+ "CODE",
230
+ "DATA",
231
+ "DATALIST",
232
+ "DFN",
233
+ "EM",
234
+ "EMBED",
235
+ "I",
236
+ "IMG",
237
+ "INPUT",
238
+ "KBD",
239
+ "LABEL",
240
+ "MARK",
241
+ "MATH",
242
+ "METER",
243
+ "NOSCRIPT",
244
+ "OBJECT",
245
+ "OUTPUT",
246
+ "PROGRESS",
247
+ "Q",
248
+ "RUBY",
249
+ "SAMP",
250
+ "SCRIPT",
251
+ "SELECT",
252
+ "SMALL",
253
+ "SPAN",
254
+ "STRONG",
255
+ "SUB",
256
+ "SUP",
257
+ "TEXTAREA",
258
+ "TIME",
259
+ "VAR",
260
+ "WBR",
261
+ ],
262
+
263
+ // These are the classes that readability sets itself.
264
+ CLASSES_TO_PRESERVE: ["page"],
265
+
266
+ // These are the list of HTML entities that need to be escaped.
267
+ HTML_ESCAPE_MAP: {
268
+ lt: "<",
269
+ gt: ">",
270
+ amp: "&",
271
+ quot: '"',
272
+ apos: "'",
273
+ },
274
+
275
+ /**
276
+ * Run any post-process modifications to article content as necessary.
277
+ *
278
+ * @param Element
279
+ * @return void
280
+ **/
281
+ _postProcessContent(articleContent) {
282
+ // Readability cannot open relative uris so we convert them to absolute uris.
283
+ this._fixRelativeUris(articleContent);
284
+
285
+ this._simplifyNestedElements(articleContent);
286
+
287
+ if (!this._keepClasses) {
288
+ // Remove classes.
289
+ this._cleanClasses(articleContent);
290
+ }
291
+ },
292
+
293
+ /**
294
+ * Iterates over a NodeList, calls `filterFn` for each node and removes node
295
+ * if function returned `true`.
296
+ *
297
+ * If function is not passed, removes all the nodes in node list.
298
+ *
299
+ * @param NodeList nodeList The nodes to operate on
300
+ * @param Function filterFn the function to use as a filter
301
+ * @return void
302
+ */
303
+ _removeNodes(nodeList, filterFn) {
304
+ // Avoid ever operating on live node lists.
305
+ if (this._docJSDOMParser && nodeList._isLiveNodeList) {
306
+ throw new Error("Do not pass live node lists to _removeNodes");
307
+ }
308
+ for (var i = nodeList.length - 1; i >= 0; i--) {
309
+ var node = nodeList[i];
310
+ var parentNode = node.parentNode;
311
+ if (parentNode) {
312
+ if (!filterFn || filterFn.call(this, node, i, nodeList)) {
313
+ parentNode.removeChild(node);
314
+ }
315
+ }
316
+ }
317
+ },
318
+
319
+ /**
320
+ * Iterates over a NodeList, and calls _setNodeTag for each node.
321
+ *
322
+ * @param NodeList nodeList The nodes to operate on
323
+ * @param String newTagName the new tag name to use
324
+ * @return void
325
+ */
326
+ _replaceNodeTags(nodeList, newTagName) {
327
+ // Avoid ever operating on live node lists.
328
+ if (this._docJSDOMParser && nodeList._isLiveNodeList) {
329
+ throw new Error("Do not pass live node lists to _replaceNodeTags");
330
+ }
331
+ for (const node of nodeList) {
332
+ this._setNodeTag(node, newTagName);
333
+ }
334
+ },
335
+
336
+ /**
337
+ * Iterate over a NodeList, which doesn't natively fully implement the Array
338
+ * interface.
339
+ *
340
+ * For convenience, the current object context is applied to the provided
341
+ * iterate function.
342
+ *
343
+ * @param NodeList nodeList The NodeList.
344
+ * @param Function fn The iterate function.
345
+ * @return void
346
+ */
347
+ _forEachNode(nodeList, fn) {
348
+ Array.prototype.forEach.call(nodeList, fn, this);
349
+ },
350
+
351
+ /**
352
+ * Iterate over a NodeList, and return the first node that passes
353
+ * the supplied test function
354
+ *
355
+ * For convenience, the current object context is applied to the provided
356
+ * test function.
357
+ *
358
+ * @param NodeList nodeList The NodeList.
359
+ * @param Function fn The test function.
360
+ * @return void
361
+ */
362
+ _findNode(nodeList, fn) {
363
+ return Array.prototype.find.call(nodeList, fn, this);
364
+ },
365
+
366
+ /**
367
+ * Iterate over a NodeList, return true if any of the provided iterate
368
+ * function calls returns true, false otherwise.
369
+ *
370
+ * For convenience, the current object context is applied to the
371
+ * provided iterate function.
372
+ *
373
+ * @param NodeList nodeList The NodeList.
374
+ * @param Function fn The iterate function.
375
+ * @return Boolean
376
+ */
377
+ _someNode(nodeList, fn) {
378
+ return Array.prototype.some.call(nodeList, fn, this);
379
+ },
380
+
381
+ /**
382
+ * Iterate over a NodeList, return true if all of the provided iterate
383
+ * function calls return true, false otherwise.
384
+ *
385
+ * For convenience, the current object context is applied to the
386
+ * provided iterate function.
387
+ *
388
+ * @param NodeList nodeList The NodeList.
389
+ * @param Function fn The iterate function.
390
+ * @return Boolean
391
+ */
392
+ _everyNode(nodeList, fn) {
393
+ return Array.prototype.every.call(nodeList, fn, this);
394
+ },
395
+
396
+ _getAllNodesWithTag(node, tagNames) {
397
+ if (node.querySelectorAll) {
398
+ return node.querySelectorAll(tagNames.join(","));
399
+ }
400
+ return [].concat.apply(
401
+ [],
402
+ tagNames.map(function (tag) {
403
+ var collection = node.getElementsByTagName(tag);
404
+ return Array.isArray(collection) ? collection : Array.from(collection);
405
+ })
406
+ );
407
+ },
408
+
409
+ /**
410
+ * Removes the class="" attribute from every element in the given
411
+ * subtree, except those that match CLASSES_TO_PRESERVE and
412
+ * the classesToPreserve array from the options object.
413
+ *
414
+ * @param Element
415
+ * @return void
416
+ */
417
+ _cleanClasses(node) {
418
+ var classesToPreserve = this._classesToPreserve;
419
+ var className = (node.getAttribute("class") || "")
420
+ .split(/\s+/)
421
+ .filter(cls => classesToPreserve.includes(cls))
422
+ .join(" ");
423
+
424
+ if (className) {
425
+ node.setAttribute("class", className);
426
+ } else {
427
+ node.removeAttribute("class");
428
+ }
429
+
430
+ for (node = node.firstElementChild; node; node = node.nextElementSibling) {
431
+ this._cleanClasses(node);
432
+ }
433
+ },
434
+
435
+ /**
436
+ * Tests whether a string is a URL or not.
437
+ *
438
+ * @param {string} str The string to test
439
+ * @return {boolean} true if str is a URL, false if not
440
+ */
441
+ _isUrl(str) {
442
+ try {
443
+ new URL(str);
444
+ return true;
445
+ } catch {
446
+ return false;
447
+ }
448
+ },
449
+ /**
450
+ * Converts each <a> and <img> uri in the given element to an absolute URI,
451
+ * ignoring #ref URIs.
452
+ *
453
+ * @param Element
454
+ * @return void
455
+ */
456
+ _fixRelativeUris(articleContent) {
457
+ var baseURI = this._doc.baseURI;
458
+ var documentURI = this._doc.documentURI;
459
+ function toAbsoluteURI(uri) {
460
+ // Leave hash links alone if the base URI matches the document URI:
461
+ if (baseURI == documentURI && uri.charAt(0) == "#") {
462
+ return uri;
463
+ }
464
+
465
+ // Otherwise, resolve against base URI:
466
+ try {
467
+ return new URL(uri, baseURI).href;
468
+ } catch (ex) {
469
+ // Something went wrong, just return the original:
470
+ }
471
+ return uri;
472
+ }
473
+
474
+ var links = this._getAllNodesWithTag(articleContent, ["a"]);
475
+ this._forEachNode(links, function (link) {
476
+ var href = link.getAttribute("href");
477
+ if (href) {
478
+ // Remove links with javascript: URIs, since
479
+ // they won't work after scripts have been removed from the page.
480
+ if (href.indexOf("javascript:") === 0) {
481
+ // if the link only contains simple text content, it can be converted to a text node
482
+ if (
483
+ link.childNodes.length === 1 &&
484
+ link.childNodes[0].nodeType === this.TEXT_NODE
485
+ ) {
486
+ var text = this._doc.createTextNode(link.textContent);
487
+ link.parentNode.replaceChild(text, link);
488
+ } else {
489
+ // if the link has multiple children, they should all be preserved
490
+ var container = this._doc.createElement("span");
491
+ while (link.firstChild) {
492
+ container.appendChild(link.firstChild);
493
+ }
494
+ link.parentNode.replaceChild(container, link);
495
+ }
496
+ } else {
497
+ link.setAttribute("href", toAbsoluteURI(href));
498
+ }
499
+ }
500
+ });
501
+
502
+ var medias = this._getAllNodesWithTag(articleContent, [
503
+ "img",
504
+ "picture",
505
+ "figure",
506
+ "video",
507
+ "audio",
508
+ "source",
509
+ ]);
510
+
511
+ this._forEachNode(medias, function (media) {
512
+ var src = media.getAttribute("src");
513
+ var poster = media.getAttribute("poster");
514
+ var srcset = media.getAttribute("srcset");
515
+
516
+ if (src) {
517
+ media.setAttribute("src", toAbsoluteURI(src));
518
+ }
519
+
520
+ if (poster) {
521
+ media.setAttribute("poster", toAbsoluteURI(poster));
522
+ }
523
+
524
+ if (srcset) {
525
+ var newSrcset = srcset.replace(
526
+ this.REGEXPS.srcsetUrl,
527
+ function (_, p1, p2, p3) {
528
+ return toAbsoluteURI(p1) + (p2 || "") + p3;
529
+ }
530
+ );
531
+
532
+ media.setAttribute("srcset", newSrcset);
533
+ }
534
+ });
535
+ },
536
+
537
+ _simplifyNestedElements(articleContent) {
538
+ var node = articleContent;
539
+
540
+ while (node) {
541
+ if (
542
+ node.parentNode &&
543
+ ["DIV", "SECTION"].includes(node.tagName) &&
544
+ !(node.id && node.id.startsWith("readability"))
545
+ ) {
546
+ if (this._isElementWithoutContent(node)) {
547
+ node = this._removeAndGetNext(node);
548
+ continue;
549
+ } else if (
550
+ this._hasSingleTagInsideElement(node, "DIV") ||
551
+ this._hasSingleTagInsideElement(node, "SECTION")
552
+ ) {
553
+ var child = node.children[0];
554
+ for (var i = 0; i < node.attributes.length; i++) {
555
+ child.setAttributeNode(node.attributes[i].cloneNode());
556
+ }
557
+ node.parentNode.replaceChild(child, node);
558
+ node = child;
559
+ continue;
560
+ }
561
+ }
562
+
563
+ node = this._getNextNode(node);
564
+ }
565
+ },
566
+
567
+ /**
568
+ * Get the article title as an H1.
569
+ *
570
+ * @return string
571
+ **/
572
+ _getArticleTitle() {
573
+ var doc = this._doc;
574
+ var curTitle = "";
575
+ var origTitle = "";
576
+
577
+ try {
578
+ curTitle = origTitle = doc.title.trim();
579
+
580
+ // If they had an element with id "title" in their HTML
581
+ if (typeof curTitle !== "string") {
582
+ curTitle = origTitle = this._getInnerText(
583
+ doc.getElementsByTagName("title")[0]
584
+ );
585
+ }
586
+ } catch (e) {
587
+ /* ignore exceptions setting the title. */
588
+ }
589
+
590
+ var titleHadHierarchicalSeparators = false;
591
+ function wordCount(str) {
592
+ return str.split(/\s+/).length;
593
+ }
594
+
595
+ // If there's a separator in the title, first remove the final part
596
+ if (/ [\|\-\\\/>»] /.test(curTitle)) {
597
+ titleHadHierarchicalSeparators = / [\\\/>»] /.test(curTitle);
598
+ let allSeparators = Array.from(origTitle.matchAll(/ [\|\-\\\/>»] /gi));
599
+ curTitle = origTitle.substring(0, allSeparators.pop().index);
600
+
601
+ // If the resulting title is too short, remove the first part instead:
602
+ if (wordCount(curTitle) < 3) {
603
+ curTitle = origTitle.replace(/^[^\|\-\\\/>»]*[\|\-\\\/>»]/gi, "");
604
+ }
605
+ } else if (curTitle.includes(": ")) {
606
+ // Check if we have an heading containing this exact string, so we
607
+ // could assume it's the full title.
608
+ var headings = this._getAllNodesWithTag(doc, ["h1", "h2"]);
609
+ var trimmedTitle = curTitle.trim();
610
+ var match = this._someNode(headings, function (heading) {
611
+ return heading.textContent.trim() === trimmedTitle;
612
+ });
613
+
614
+ // If we don't, let's extract the title out of the original title string.
615
+ if (!match) {
616
+ curTitle = origTitle.substring(origTitle.lastIndexOf(":") + 1);
617
+
618
+ // If the title is now too short, try the first colon instead:
619
+ if (wordCount(curTitle) < 3) {
620
+ curTitle = origTitle.substring(origTitle.indexOf(":") + 1);
621
+ // But if we have too many words before the colon there's something weird
622
+ // with the titles and the H tags so let's just use the original title instead
623
+ } else if (wordCount(origTitle.substr(0, origTitle.indexOf(":"))) > 5) {
624
+ curTitle = origTitle;
625
+ }
626
+ }
627
+ } else if (curTitle.length > 150 || curTitle.length < 15) {
628
+ var hOnes = doc.getElementsByTagName("h1");
629
+
630
+ if (hOnes.length === 1) {
631
+ curTitle = this._getInnerText(hOnes[0]);
632
+ }
633
+ }
634
+
635
+ curTitle = curTitle.trim().replace(this.REGEXPS.normalize, " ");
636
+ // If we now have 4 words or fewer as our title, and either no
637
+ // 'hierarchical' separators (\, /, > or ») were found in the original
638
+ // title or we decreased the number of words by more than 1 word, use
639
+ // the original title.
640
+ var curTitleWordCount = wordCount(curTitle);
641
+ if (
642
+ curTitleWordCount <= 4 &&
643
+ (!titleHadHierarchicalSeparators ||
644
+ curTitleWordCount !=
645
+ wordCount(origTitle.replace(/[\|\-\\\/>»]+/g, "")) - 1)
646
+ ) {
647
+ curTitle = origTitle;
648
+ }
649
+
650
+ return curTitle;
651
+ },
652
+
653
+ /**
654
+ * Prepare the HTML document for readability to scrape it.
655
+ * This includes things like stripping javascript, CSS, and handling terrible markup.
656
+ *
657
+ * @return void
658
+ **/
659
+ _prepDocument() {
660
+ var doc = this._doc;
661
+
662
+ // Remove all style tags in head
663
+ this._removeNodes(this._getAllNodesWithTag(doc, ["style"]));
664
+
665
+ if (doc.body) {
666
+ this._replaceBrs(doc.body);
667
+ }
668
+
669
+ this._replaceNodeTags(this._getAllNodesWithTag(doc, ["font"]), "SPAN");
670
+ },
671
+
672
+ /**
673
+ * Finds the next node, starting from the given node, and ignoring
674
+ * whitespace in between. If the given node is an element, the same node is
675
+ * returned.
676
+ */
677
+ _nextNode(node) {
678
+ var next = node;
679
+ while (
680
+ next &&
681
+ next.nodeType != this.ELEMENT_NODE &&
682
+ this.REGEXPS.whitespace.test(next.textContent)
683
+ ) {
684
+ next = next.nextSibling;
685
+ }
686
+ return next;
687
+ },
688
+
689
+ /**
690
+ * Replaces 2 or more successive <br> elements with a single <p>.
691
+ * Whitespace between <br> elements are ignored. For example:
692
+ * <div>foo<br>bar<br> <br><br>abc</div>
693
+ * will become:
694
+ * <div>foo<br>bar<p>abc</p></div>
695
+ */
696
+ _replaceBrs(elem) {
697
+ this._forEachNode(this._getAllNodesWithTag(elem, ["br"]), function (br) {
698
+ var next = br.nextSibling;
699
+
700
+ // Whether 2 or more <br> elements have been found and replaced with a
701
+ // <p> block.
702
+ var replaced = false;
703
+
704
+ // If we find a <br> chain, remove the <br>s until we hit another node
705
+ // or non-whitespace. This leaves behind the first <br> in the chain
706
+ // (which will be replaced with a <p> later).
707
+ while ((next = this._nextNode(next)) && next.tagName == "BR") {
708
+ replaced = true;
709
+ var brSibling = next.nextSibling;
710
+ next.remove();
711
+ next = brSibling;
712
+ }
713
+
714
+ // If we removed a <br> chain, replace the remaining <br> with a <p>. Add
715
+ // all sibling nodes as children of the <p> until we hit another <br>
716
+ // chain.
717
+ if (replaced) {
718
+ var p = this._doc.createElement("p");
719
+ br.parentNode.replaceChild(p, br);
720
+
721
+ next = p.nextSibling;
722
+ while (next) {
723
+ // If we've hit another <br><br>, we're done adding children to this <p>.
724
+ if (next.tagName == "BR") {
725
+ var nextElem = this._nextNode(next.nextSibling);
726
+ if (nextElem && nextElem.tagName == "BR") {
727
+ break;
728
+ }
729
+ }
730
+
731
+ if (!this._isPhrasingContent(next)) {
732
+ break;
733
+ }
734
+
735
+ // Otherwise, make this node a child of the new <p>.
736
+ var sibling = next.nextSibling;
737
+ p.appendChild(next);
738
+ next = sibling;
739
+ }
740
+
741
+ while (p.lastChild && this._isWhitespace(p.lastChild)) {
742
+ p.lastChild.remove();
743
+ }
744
+
745
+ if (p.parentNode.tagName === "P") {
746
+ this._setNodeTag(p.parentNode, "DIV");
747
+ }
748
+ }
749
+ });
750
+ },
751
+
752
+ _setNodeTag(node, tag) {
753
+ this.log("_setNodeTag", node, tag);
754
+ if (this._docJSDOMParser) {
755
+ node.localName = tag.toLowerCase();
756
+ node.tagName = tag.toUpperCase();
757
+ return node;
758
+ }
759
+
760
+ var replacement = node.ownerDocument.createElement(tag);
761
+ while (node.firstChild) {
762
+ replacement.appendChild(node.firstChild);
763
+ }
764
+ node.parentNode.replaceChild(replacement, node);
765
+ if (node.readability) {
766
+ replacement.readability = node.readability;
767
+ }
768
+
769
+ for (var i = 0; i < node.attributes.length; i++) {
770
+ replacement.setAttributeNode(node.attributes[i].cloneNode());
771
+ }
772
+ return replacement;
773
+ },
774
+
775
+ /**
776
+ * Prepare the article node for display. Clean out any inline styles,
777
+ * iframes, forms, strip extraneous <p> tags, etc.
778
+ *
779
+ * @param Element
780
+ * @return void
781
+ **/
782
+ _prepArticle(articleContent) {
783
+ this._cleanStyles(articleContent);
784
+
785
+ // Check for data tables before we continue, to avoid removing items in
786
+ // those tables, which will often be isolated even though they're
787
+ // visually linked to other content-ful elements (text, images, etc.).
788
+ this._markDataTables(articleContent);
789
+
790
+ this._fixLazyImages(articleContent);
791
+
792
+ // Clean out junk from the article content
793
+ this._cleanConditionally(articleContent, "form");
794
+ this._cleanConditionally(articleContent, "fieldset");
795
+ this._clean(articleContent, "object");
796
+ this._clean(articleContent, "embed");
797
+ this._clean(articleContent, "footer");
798
+ this._clean(articleContent, "link");
799
+ this._clean(articleContent, "aside");
800
+
801
+ // Clean out elements with little content that have "share" in their id/class combinations from final top candidates,
802
+ // which means we don't remove the top candidates even they have "share".
803
+
804
+ var shareElementThreshold = this.DEFAULT_CHAR_THRESHOLD;
805
+
806
+ this._forEachNode(articleContent.children, function (topCandidate) {
807
+ this._cleanMatchedNodes(topCandidate, function (node, matchString) {
808
+ return (
809
+ this.REGEXPS.shareElements.test(matchString) &&
810
+ node.textContent.length < shareElementThreshold
811
+ );
812
+ });
813
+ });
814
+
815
+ this._clean(articleContent, "iframe");
816
+ this._clean(articleContent, "input");
817
+ this._clean(articleContent, "textarea");
818
+ this._clean(articleContent, "select");
819
+ this._clean(articleContent, "button");
820
+ this._cleanHeaders(articleContent);
821
+
822
+ // Do these last as the previous stuff may have removed junk
823
+ // that will affect these
824
+ this._cleanConditionally(articleContent, "table");
825
+ this._cleanConditionally(articleContent, "ul");
826
+ this._cleanConditionally(articleContent, "div");
827
+
828
+ // replace H1 with H2 as H1 should be only title that is displayed separately
829
+ this._replaceNodeTags(
830
+ this._getAllNodesWithTag(articleContent, ["h1"]),
831
+ "h2"
832
+ );
833
+
834
+ // Remove extra paragraphs
835
+ this._removeNodes(
836
+ this._getAllNodesWithTag(articleContent, ["p"]),
837
+ function (paragraph) {
838
+ // At this point, nasty iframes have been removed; only embedded video
839
+ // ones remain.
840
+ var contentElementCount = this._getAllNodesWithTag(paragraph, [
841
+ "img",
842
+ "embed",
843
+ "object",
844
+ "iframe",
845
+ ]).length;
846
+ return (
847
+ contentElementCount === 0 && !this._getInnerText(paragraph, false)
848
+ );
849
+ }
850
+ );
851
+
852
+ this._forEachNode(
853
+ this._getAllNodesWithTag(articleContent, ["br"]),
854
+ function (br) {
855
+ var next = this._nextNode(br.nextSibling);
856
+ if (next && next.tagName == "P") {
857
+ br.remove();
858
+ }
859
+ }
860
+ );
861
+
862
+ // Remove single-cell tables
863
+ this._forEachNode(
864
+ this._getAllNodesWithTag(articleContent, ["table"]),
865
+ function (table) {
866
+ var tbody = this._hasSingleTagInsideElement(table, "TBODY")
867
+ ? table.firstElementChild
868
+ : table;
869
+ if (this._hasSingleTagInsideElement(tbody, "TR")) {
870
+ var row = tbody.firstElementChild;
871
+ if (this._hasSingleTagInsideElement(row, "TD")) {
872
+ var cell = row.firstElementChild;
873
+ cell = this._setNodeTag(
874
+ cell,
875
+ this._everyNode(cell.childNodes, this._isPhrasingContent)
876
+ ? "P"
877
+ : "DIV"
878
+ );
879
+ table.parentNode.replaceChild(cell, table);
880
+ }
881
+ }
882
+ }
883
+ );
884
+ },
885
+
886
+ /**
887
+ * Initialize a node with the readability object. Also checks the
888
+ * className/id for special names to add to its score.
889
+ *
890
+ * @param Element
891
+ * @return void
892
+ **/
893
+ _initializeNode(node) {
894
+ node.readability = { contentScore: 0 };
895
+
896
+ switch (node.tagName) {
897
+ case "DIV":
898
+ node.readability.contentScore += 5;
899
+ break;
900
+
901
+ case "PRE":
902
+ case "TD":
903
+ case "BLOCKQUOTE":
904
+ node.readability.contentScore += 3;
905
+ break;
906
+
907
+ case "ADDRESS":
908
+ case "OL":
909
+ case "UL":
910
+ case "DL":
911
+ case "DD":
912
+ case "DT":
913
+ case "LI":
914
+ case "FORM":
915
+ node.readability.contentScore -= 3;
916
+ break;
917
+
918
+ case "H1":
919
+ case "H2":
920
+ case "H3":
921
+ case "H4":
922
+ case "H5":
923
+ case "H6":
924
+ case "TH":
925
+ node.readability.contentScore -= 5;
926
+ break;
927
+ }
928
+
929
+ node.readability.contentScore += this._getClassWeight(node);
930
+ },
931
+
932
+ _removeAndGetNext(node) {
933
+ var nextNode = this._getNextNode(node, true);
934
+ node.remove();
935
+ return nextNode;
936
+ },
937
+
938
+ /**
939
+ * Traverse the DOM from node to node, starting at the node passed in.
940
+ * Pass true for the second parameter to indicate this node itself
941
+ * (and its kids) are going away, and we want the next node over.
942
+ *
943
+ * Calling this in a loop will traverse the DOM depth-first.
944
+ *
945
+ * @param {Element} node
946
+ * @param {boolean} ignoreSelfAndKids
947
+ * @return {Element}
948
+ */
949
+ _getNextNode(node, ignoreSelfAndKids) {
950
+ // First check for kids if those aren't being ignored
951
+ if (!ignoreSelfAndKids && node.firstElementChild) {
952
+ return node.firstElementChild;
953
+ }
954
+ // Then for siblings...
955
+ if (node.nextElementSibling) {
956
+ return node.nextElementSibling;
957
+ }
958
+ // And finally, move up the parent chain *and* find a sibling
959
+ // (because this is depth-first traversal, we will have already
960
+ // seen the parent nodes themselves).
961
+ do {
962
+ node = node.parentNode;
963
+ } while (node && !node.nextElementSibling);
964
+ return node && node.nextElementSibling;
965
+ },
966
+
967
+ // compares second text to first one
968
+ // 1 = same text, 0 = completely different text
969
+ // works the way that it splits both texts into words and then finds words that are unique in second text
970
+ // the result is given by the lower length of unique parts
971
+ _textSimilarity(textA, textB) {
972
+ var tokensA = textA
973
+ .toLowerCase()
974
+ .split(this.REGEXPS.tokenize)
975
+ .filter(Boolean);
976
+ var tokensB = textB
977
+ .toLowerCase()
978
+ .split(this.REGEXPS.tokenize)
979
+ .filter(Boolean);
980
+ if (!tokensA.length || !tokensB.length) {
981
+ return 0;
982
+ }
983
+ var uniqTokensB = tokensB.filter(token => !tokensA.includes(token));
984
+ var distanceB = uniqTokensB.join(" ").length / tokensB.join(" ").length;
985
+ return 1 - distanceB;
986
+ },
987
+
988
+ /**
989
+ * Checks whether an element node contains a valid byline
990
+ *
991
+ * @param node {Element}
992
+ * @param matchString {string}
993
+ * @return boolean
994
+ */
995
+ _isValidByline(node, matchString) {
996
+ var rel = node.getAttribute("rel");
997
+ var itemprop = node.getAttribute("itemprop");
998
+ var bylineLength = node.textContent.trim().length;
999
+
1000
+ return (
1001
+ (rel === "author" ||
1002
+ (itemprop && itemprop.includes("author")) ||
1003
+ this.REGEXPS.byline.test(matchString)) &&
1004
+ !!bylineLength &&
1005
+ bylineLength < 100
1006
+ );
1007
+ },
1008
+
1009
+ _getNodeAncestors(node, maxDepth) {
1010
+ maxDepth = maxDepth || 0;
1011
+ var i = 0,
1012
+ ancestors = [];
1013
+ while (node.parentNode) {
1014
+ ancestors.push(node.parentNode);
1015
+ if (maxDepth && ++i === maxDepth) {
1016
+ break;
1017
+ }
1018
+ node = node.parentNode;
1019
+ }
1020
+ return ancestors;
1021
+ },
1022
+
1023
+ /***
1024
+ * grabArticle - Using a variety of metrics (content score, classname, element types), find the content that is
1025
+ * most likely to be the stuff a user wants to read. Then return it wrapped up in a div.
1026
+ *
1027
+ * @param page a document to run upon. Needs to be a full document, complete with body.
1028
+ * @return Element
1029
+ **/
1030
+ /* eslint-disable-next-line complexity */
1031
+ _grabArticle(page) {
1032
+ this.log("**** grabArticle ****");
1033
+ var doc = this._doc;
1034
+ var isPaging = page !== null;
1035
+ page = page ? page : this._doc.body;
1036
+
1037
+ // We can't grab an article if we don't have a page!
1038
+ if (!page) {
1039
+ this.log("No body found in document. Abort.");
1040
+ return null;
1041
+ }
1042
+
1043
+ var pageCacheHtml = page.innerHTML;
1044
+
1045
+ while (true) {
1046
+ this.log("Starting grabArticle loop");
1047
+ var stripUnlikelyCandidates = this._flagIsActive(
1048
+ this.FLAG_STRIP_UNLIKELYS
1049
+ );
1050
+
1051
+ // First, node prepping. Trash nodes that look cruddy (like ones with the
1052
+ // class name "comment", etc), and turn divs into P tags where they have been
1053
+ // used inappropriately (as in, where they contain no other block level elements.)
1054
+ var elementsToScore = [];
1055
+ var node = this._doc.documentElement;
1056
+
1057
+ let shouldRemoveTitleHeader = true;
1058
+
1059
+ while (node) {
1060
+ if (node.tagName === "HTML") {
1061
+ this._articleLang = node.getAttribute("lang");
1062
+ }
1063
+
1064
+ var matchString = node.className + " " + node.id;
1065
+
1066
+ if (!this._isProbablyVisible(node)) {
1067
+ this.log("Removing hidden node - " + matchString);
1068
+ node = this._removeAndGetNext(node);
1069
+ continue;
1070
+ }
1071
+
1072
+ // User is not able to see elements applied with both "aria-modal = true" and "role = dialog"
1073
+ if (
1074
+ node.getAttribute("aria-modal") == "true" &&
1075
+ node.getAttribute("role") == "dialog"
1076
+ ) {
1077
+ node = this._removeAndGetNext(node);
1078
+ continue;
1079
+ }
1080
+
1081
+ // If we don't have a byline yet check to see if this node is a byline; if it is store the byline and remove the node.
1082
+ if (
1083
+ !this._articleByline &&
1084
+ !this._metadata.byline &&
1085
+ this._isValidByline(node, matchString)
1086
+ ) {
1087
+ // Find child node matching [itemprop="name"] and use that if it exists for a more accurate author name byline
1088
+ var endOfSearchMarkerNode = this._getNextNode(node, true);
1089
+ var next = this._getNextNode(node);
1090
+ var itemPropNameNode = null;
1091
+ while (next && next != endOfSearchMarkerNode) {
1092
+ var itemprop = next.getAttribute("itemprop");
1093
+ if (itemprop && itemprop.includes("name")) {
1094
+ itemPropNameNode = next;
1095
+ break;
1096
+ } else {
1097
+ next = this._getNextNode(next);
1098
+ }
1099
+ }
1100
+ this._articleByline = (itemPropNameNode ?? node).textContent.trim();
1101
+ node = this._removeAndGetNext(node);
1102
+ continue;
1103
+ }
1104
+
1105
+ if (shouldRemoveTitleHeader && this._headerDuplicatesTitle(node)) {
1106
+ this.log(
1107
+ "Removing header: ",
1108
+ node.textContent.trim(),
1109
+ this._articleTitle.trim()
1110
+ );
1111
+ shouldRemoveTitleHeader = false;
1112
+ node = this._removeAndGetNext(node);
1113
+ continue;
1114
+ }
1115
+
1116
+ // Remove unlikely candidates
1117
+ if (stripUnlikelyCandidates) {
1118
+ if (
1119
+ this.REGEXPS.unlikelyCandidates.test(matchString) &&
1120
+ !this.REGEXPS.okMaybeItsACandidate.test(matchString) &&
1121
+ !this._hasAncestorTag(node, "table") &&
1122
+ !this._hasAncestorTag(node, "code") &&
1123
+ node.tagName !== "BODY" &&
1124
+ node.tagName !== "A"
1125
+ ) {
1126
+ this.log("Removing unlikely candidate - " + matchString);
1127
+ node = this._removeAndGetNext(node);
1128
+ continue;
1129
+ }
1130
+
1131
+ if (this.UNLIKELY_ROLES.includes(node.getAttribute("role"))) {
1132
+ this.log(
1133
+ "Removing content with role " +
1134
+ node.getAttribute("role") +
1135
+ " - " +
1136
+ matchString
1137
+ );
1138
+ node = this._removeAndGetNext(node);
1139
+ continue;
1140
+ }
1141
+ }
1142
+
1143
+ // Remove DIV, SECTION, and HEADER nodes without any content(e.g. text, image, video, or iframe).
1144
+ if (
1145
+ (node.tagName === "DIV" ||
1146
+ node.tagName === "SECTION" ||
1147
+ node.tagName === "HEADER" ||
1148
+ node.tagName === "H1" ||
1149
+ node.tagName === "H2" ||
1150
+ node.tagName === "H3" ||
1151
+ node.tagName === "H4" ||
1152
+ node.tagName === "H5" ||
1153
+ node.tagName === "H6") &&
1154
+ this._isElementWithoutContent(node)
1155
+ ) {
1156
+ node = this._removeAndGetNext(node);
1157
+ continue;
1158
+ }
1159
+
1160
+ if (this.DEFAULT_TAGS_TO_SCORE.includes(node.tagName)) {
1161
+ elementsToScore.push(node);
1162
+ }
1163
+
1164
+ // Turn all divs that don't have children block level elements into p's
1165
+ if (node.tagName === "DIV") {
1166
+ // Put phrasing content into paragraphs.
1167
+ var p = null;
1168
+ var childNode = node.firstChild;
1169
+ while (childNode) {
1170
+ var nextSibling = childNode.nextSibling;
1171
+ if (this._isPhrasingContent(childNode)) {
1172
+ if (p !== null) {
1173
+ p.appendChild(childNode);
1174
+ } else if (!this._isWhitespace(childNode)) {
1175
+ p = doc.createElement("p");
1176
+ node.replaceChild(p, childNode);
1177
+ p.appendChild(childNode);
1178
+ }
1179
+ } else if (p !== null) {
1180
+ while (p.lastChild && this._isWhitespace(p.lastChild)) {
1181
+ p.lastChild.remove();
1182
+ }
1183
+ p = null;
1184
+ }
1185
+ childNode = nextSibling;
1186
+ }
1187
+
1188
+ // Sites like http://mobile.slate.com encloses each paragraph with a DIV
1189
+ // element. DIVs with only a P element inside and no text content can be
1190
+ // safely converted into plain P elements to avoid confusing the scoring
1191
+ // algorithm with DIVs with are, in practice, paragraphs.
1192
+ if (
1193
+ this._hasSingleTagInsideElement(node, "P") &&
1194
+ this._getLinkDensity(node) < 0.25
1195
+ ) {
1196
+ var newNode = node.children[0];
1197
+ node.parentNode.replaceChild(newNode, node);
1198
+ node = newNode;
1199
+ elementsToScore.push(node);
1200
+ } else if (!this._hasChildBlockElement(node)) {
1201
+ node = this._setNodeTag(node, "P");
1202
+ elementsToScore.push(node);
1203
+ }
1204
+ }
1205
+ node = this._getNextNode(node);
1206
+ }
1207
+
1208
+ /**
1209
+ * Loop through all paragraphs, and assign a score to them based on how content-y they look.
1210
+ * Then add their score to their parent node.
1211
+ *
1212
+ * A score is determined by things like number of commas, class names, etc. Maybe eventually link density.
1213
+ **/
1214
+ var candidates = [];
1215
+ this._forEachNode(elementsToScore, function (elementToScore) {
1216
+ if (
1217
+ !elementToScore.parentNode ||
1218
+ typeof elementToScore.parentNode.tagName === "undefined"
1219
+ ) {
1220
+ return;
1221
+ }
1222
+
1223
+ // If this paragraph is less than 25 characters, don't even count it.
1224
+ var innerText = this._getInnerText(elementToScore);
1225
+ if (innerText.length < 25) {
1226
+ return;
1227
+ }
1228
+
1229
+ // Exclude nodes with no ancestor.
1230
+ var ancestors = this._getNodeAncestors(elementToScore, 5);
1231
+ if (ancestors.length === 0) {
1232
+ return;
1233
+ }
1234
+
1235
+ var contentScore = 0;
1236
+
1237
+ // Add a point for the paragraph itself as a base.
1238
+ contentScore += 1;
1239
+
1240
+ // Add points for any commas within this paragraph.
1241
+ contentScore += innerText.split(this.REGEXPS.commas).length;
1242
+
1243
+ // For every 100 characters in this paragraph, add another point. Up to 3 points.
1244
+ contentScore += Math.min(Math.floor(innerText.length / 100), 3);
1245
+
1246
+ // Initialize and score ancestors.
1247
+ this._forEachNode(ancestors, function (ancestor, level) {
1248
+ if (
1249
+ !ancestor.tagName ||
1250
+ !ancestor.parentNode ||
1251
+ typeof ancestor.parentNode.tagName === "undefined"
1252
+ ) {
1253
+ return;
1254
+ }
1255
+
1256
+ if (typeof ancestor.readability === "undefined") {
1257
+ this._initializeNode(ancestor);
1258
+ candidates.push(ancestor);
1259
+ }
1260
+
1261
+ // Node score divider:
1262
+ // - parent: 1 (no division)
1263
+ // - grandparent: 2
1264
+ // - great grandparent+: ancestor level * 3
1265
+ if (level === 0) {
1266
+ var scoreDivider = 1;
1267
+ } else if (level === 1) {
1268
+ scoreDivider = 2;
1269
+ } else {
1270
+ scoreDivider = level * 3;
1271
+ }
1272
+ ancestor.readability.contentScore += contentScore / scoreDivider;
1273
+ });
1274
+ });
1275
+
1276
+ // After we've calculated scores, loop through all of the possible
1277
+ // candidate nodes we found and find the one with the highest score.
1278
+ var topCandidates = [];
1279
+ for (var c = 0, cl = candidates.length; c < cl; c += 1) {
1280
+ var candidate = candidates[c];
1281
+
1282
+ // Scale the final candidates score based on link density. Good content
1283
+ // should have a relatively small link density (5% or less) and be mostly
1284
+ // unaffected by this operation.
1285
+ var candidateScore =
1286
+ candidate.readability.contentScore *
1287
+ (1 - this._getLinkDensity(candidate));
1288
+ candidate.readability.contentScore = candidateScore;
1289
+
1290
+ this.log("Candidate:", candidate, "with score " + candidateScore);
1291
+
1292
+ for (var t = 0; t < this._nbTopCandidates; t++) {
1293
+ var aTopCandidate = topCandidates[t];
1294
+
1295
+ if (
1296
+ !aTopCandidate ||
1297
+ candidateScore > aTopCandidate.readability.contentScore
1298
+ ) {
1299
+ topCandidates.splice(t, 0, candidate);
1300
+ if (topCandidates.length > this._nbTopCandidates) {
1301
+ topCandidates.pop();
1302
+ }
1303
+ break;
1304
+ }
1305
+ }
1306
+ }
1307
+
1308
+ var topCandidate = topCandidates[0] || null;
1309
+ var neededToCreateTopCandidate = false;
1310
+ var parentOfTopCandidate;
1311
+
1312
+ // If we still have no top candidate, just use the body as a last resort.
1313
+ // We also have to copy the body node so it is something we can modify.
1314
+ if (topCandidate === null || topCandidate.tagName === "BODY") {
1315
+ // Move all of the page's children into topCandidate
1316
+ topCandidate = doc.createElement("DIV");
1317
+ neededToCreateTopCandidate = true;
1318
+ // Move everything (not just elements, also text nodes etc.) into the container
1319
+ // so we even include text directly in the body:
1320
+ while (page.firstChild) {
1321
+ this.log("Moving child out:", page.firstChild);
1322
+ topCandidate.appendChild(page.firstChild);
1323
+ }
1324
+
1325
+ page.appendChild(topCandidate);
1326
+
1327
+ this._initializeNode(topCandidate);
1328
+ } else if (topCandidate) {
1329
+ // Find a better top candidate node if it contains (at least three) nodes which belong to `topCandidates` array
1330
+ // and whose scores are quite closed with current `topCandidate` node.
1331
+ var alternativeCandidateAncestors = [];
1332
+ for (var i = 1; i < topCandidates.length; i++) {
1333
+ if (
1334
+ topCandidates[i].readability.contentScore /
1335
+ topCandidate.readability.contentScore >=
1336
+ 0.75
1337
+ ) {
1338
+ alternativeCandidateAncestors.push(
1339
+ this._getNodeAncestors(topCandidates[i])
1340
+ );
1341
+ }
1342
+ }
1343
+ var MINIMUM_TOPCANDIDATES = 3;
1344
+ if (alternativeCandidateAncestors.length >= MINIMUM_TOPCANDIDATES) {
1345
+ parentOfTopCandidate = topCandidate.parentNode;
1346
+ while (parentOfTopCandidate.tagName !== "BODY") {
1347
+ var listsContainingThisAncestor = 0;
1348
+ for (
1349
+ var ancestorIndex = 0;
1350
+ ancestorIndex < alternativeCandidateAncestors.length &&
1351
+ listsContainingThisAncestor < MINIMUM_TOPCANDIDATES;
1352
+ ancestorIndex++
1353
+ ) {
1354
+ listsContainingThisAncestor += Number(
1355
+ alternativeCandidateAncestors[ancestorIndex].includes(
1356
+ parentOfTopCandidate
1357
+ )
1358
+ );
1359
+ }
1360
+ if (listsContainingThisAncestor >= MINIMUM_TOPCANDIDATES) {
1361
+ topCandidate = parentOfTopCandidate;
1362
+ break;
1363
+ }
1364
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
1365
+ }
1366
+ }
1367
+ if (!topCandidate.readability) {
1368
+ this._initializeNode(topCandidate);
1369
+ }
1370
+
1371
+ // Because of our bonus system, parents of candidates might have scores
1372
+ // themselves. They get half of the node. There won't be nodes with higher
1373
+ // scores than our topCandidate, but if we see the score going *up* in the first
1374
+ // few steps up the tree, that's a decent sign that there might be more content
1375
+ // lurking in other places that we want to unify in. The sibling stuff
1376
+ // below does some of that - but only if we've looked high enough up the DOM
1377
+ // tree.
1378
+ parentOfTopCandidate = topCandidate.parentNode;
1379
+ var lastScore = topCandidate.readability.contentScore;
1380
+ // The scores shouldn't get too low.
1381
+ var scoreThreshold = lastScore / 3;
1382
+ while (parentOfTopCandidate.tagName !== "BODY") {
1383
+ if (!parentOfTopCandidate.readability) {
1384
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
1385
+ continue;
1386
+ }
1387
+ var parentScore = parentOfTopCandidate.readability.contentScore;
1388
+ if (parentScore < scoreThreshold) {
1389
+ break;
1390
+ }
1391
+ if (parentScore > lastScore) {
1392
+ // Alright! We found a better parent to use.
1393
+ topCandidate = parentOfTopCandidate;
1394
+ break;
1395
+ }
1396
+ lastScore = parentOfTopCandidate.readability.contentScore;
1397
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
1398
+ }
1399
+
1400
+ // If the top candidate is the only child, use parent instead. This will help sibling
1401
+ // joining logic when adjacent content is actually located in parent's sibling node.
1402
+ parentOfTopCandidate = topCandidate.parentNode;
1403
+ while (
1404
+ parentOfTopCandidate.tagName != "BODY" &&
1405
+ parentOfTopCandidate.children.length == 1
1406
+ ) {
1407
+ topCandidate = parentOfTopCandidate;
1408
+ parentOfTopCandidate = topCandidate.parentNode;
1409
+ }
1410
+ if (!topCandidate.readability) {
1411
+ this._initializeNode(topCandidate);
1412
+ }
1413
+ }
1414
+
1415
+ // Now that we have the top candidate, look through its siblings for content
1416
+ // that might also be related. Things like preambles, content split by ads
1417
+ // that we removed, etc.
1418
+ var articleContent = doc.createElement("DIV");
1419
+ if (isPaging) {
1420
+ articleContent.id = "readability-content";
1421
+ }
1422
+
1423
+ var siblingScoreThreshold = Math.max(
1424
+ 10,
1425
+ topCandidate.readability.contentScore * 0.2
1426
+ );
1427
+ // Keep potential top candidate's parent node to try to get text direction of it later.
1428
+ parentOfTopCandidate = topCandidate.parentNode;
1429
+ var siblings = parentOfTopCandidate.children;
1430
+
1431
+ for (var s = 0, sl = siblings.length; s < sl; s++) {
1432
+ var sibling = siblings[s];
1433
+ var append = false;
1434
+
1435
+ this.log(
1436
+ "Looking at sibling node:",
1437
+ sibling,
1438
+ sibling.readability
1439
+ ? "with score " + sibling.readability.contentScore
1440
+ : ""
1441
+ );
1442
+ this.log(
1443
+ "Sibling has score",
1444
+ sibling.readability ? sibling.readability.contentScore : "Unknown"
1445
+ );
1446
+
1447
+ if (sibling === topCandidate) {
1448
+ append = true;
1449
+ } else {
1450
+ var contentBonus = 0;
1451
+
1452
+ // Give a bonus if sibling nodes and top candidates have the example same classname
1453
+ if (
1454
+ sibling.className === topCandidate.className &&
1455
+ topCandidate.className !== ""
1456
+ ) {
1457
+ contentBonus += topCandidate.readability.contentScore * 0.2;
1458
+ }
1459
+
1460
+ if (
1461
+ sibling.readability &&
1462
+ sibling.readability.contentScore + contentBonus >=
1463
+ siblingScoreThreshold
1464
+ ) {
1465
+ append = true;
1466
+ } else if (sibling.nodeName === "P") {
1467
+ var linkDensity = this._getLinkDensity(sibling);
1468
+ var nodeContent = this._getInnerText(sibling);
1469
+ var nodeLength = nodeContent.length;
1470
+
1471
+ if (nodeLength > 80 && linkDensity < 0.25) {
1472
+ append = true;
1473
+ } else if (
1474
+ nodeLength < 80 &&
1475
+ nodeLength > 0 &&
1476
+ linkDensity === 0 &&
1477
+ nodeContent.search(/\.( |$)/) !== -1
1478
+ ) {
1479
+ append = true;
1480
+ }
1481
+ }
1482
+ }
1483
+
1484
+ if (append) {
1485
+ this.log("Appending node:", sibling);
1486
+
1487
+ if (!this.ALTER_TO_DIV_EXCEPTIONS.includes(sibling.nodeName)) {
1488
+ // We have a node that isn't a common block level element, like a form or td tag.
1489
+ // Turn it into a div so it doesn't get filtered out later by accident.
1490
+ this.log("Altering sibling:", sibling, "to div.");
1491
+
1492
+ sibling = this._setNodeTag(sibling, "DIV");
1493
+ }
1494
+
1495
+ articleContent.appendChild(sibling);
1496
+ // Fetch children again to make it compatible
1497
+ // with DOM parsers without live collection support.
1498
+ siblings = parentOfTopCandidate.children;
1499
+ // siblings is a reference to the children array, and
1500
+ // sibling is removed from the array when we call appendChild().
1501
+ // As a result, we must revisit this index since the nodes
1502
+ // have been shifted.
1503
+ s -= 1;
1504
+ sl -= 1;
1505
+ }
1506
+ }
1507
+
1508
+ if (this._debug) {
1509
+ this.log("Article content pre-prep: " + articleContent.innerHTML);
1510
+ }
1511
+ // So we have all of the content that we need. Now we clean it up for presentation.
1512
+ this._prepArticle(articleContent);
1513
+ if (this._debug) {
1514
+ this.log("Article content post-prep: " + articleContent.innerHTML);
1515
+ }
1516
+
1517
+ if (neededToCreateTopCandidate) {
1518
+ // We already created a fake div thing, and there wouldn't have been any siblings left
1519
+ // for the previous loop, so there's no point trying to create a new div, and then
1520
+ // move all the children over. Just assign IDs and class names here. No need to append
1521
+ // because that already happened anyway.
1522
+ topCandidate.id = "readability-page-1";
1523
+ topCandidate.className = "page";
1524
+ } else {
1525
+ var div = doc.createElement("DIV");
1526
+ div.id = "readability-page-1";
1527
+ div.className = "page";
1528
+ while (articleContent.firstChild) {
1529
+ div.appendChild(articleContent.firstChild);
1530
+ }
1531
+ articleContent.appendChild(div);
1532
+ }
1533
+
1534
+ if (this._debug) {
1535
+ this.log("Article content after paging: " + articleContent.innerHTML);
1536
+ }
1537
+
1538
+ var parseSuccessful = true;
1539
+
1540
+ // Now that we've gone through the full algorithm, check to see if
1541
+ // we got any meaningful content. If we didn't, we may need to re-run
1542
+ // grabArticle with different flags set. This gives us a higher likelihood of
1543
+ // finding the content, and the sieve approach gives us a higher likelihood of
1544
+ // finding the -right- content.
1545
+ var textLength = this._getInnerText(articleContent, true).length;
1546
+ if (textLength < this._charThreshold) {
1547
+ parseSuccessful = false;
1548
+ // eslint-disable-next-line no-unsanitized/property
1549
+ page.innerHTML = pageCacheHtml;
1550
+
1551
+ this._attempts.push({
1552
+ articleContent,
1553
+ textLength,
1554
+ });
1555
+
1556
+ if (this._flagIsActive(this.FLAG_STRIP_UNLIKELYS)) {
1557
+ this._removeFlag(this.FLAG_STRIP_UNLIKELYS);
1558
+ } else if (this._flagIsActive(this.FLAG_WEIGHT_CLASSES)) {
1559
+ this._removeFlag(this.FLAG_WEIGHT_CLASSES);
1560
+ } else if (this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)) {
1561
+ this._removeFlag(this.FLAG_CLEAN_CONDITIONALLY);
1562
+ } else {
1563
+ // No luck after removing flags, just return the longest text we found during the different loops
1564
+ this._attempts.sort(function (a, b) {
1565
+ return b.textLength - a.textLength;
1566
+ });
1567
+
1568
+ // But first check if we actually have something
1569
+ if (!this._attempts[0].textLength) {
1570
+ return null;
1571
+ }
1572
+
1573
+ articleContent = this._attempts[0].articleContent;
1574
+ parseSuccessful = true;
1575
+ }
1576
+ }
1577
+
1578
+ if (parseSuccessful) {
1579
+ // Find out text direction from ancestors of final top candidate.
1580
+ var ancestors = [parentOfTopCandidate, topCandidate].concat(
1581
+ this._getNodeAncestors(parentOfTopCandidate)
1582
+ );
1583
+ this._someNode(ancestors, function (ancestor) {
1584
+ if (!ancestor.tagName) {
1585
+ return false;
1586
+ }
1587
+ var articleDir = ancestor.getAttribute("dir");
1588
+ if (articleDir) {
1589
+ this._articleDir = articleDir;
1590
+ return true;
1591
+ }
1592
+ return false;
1593
+ });
1594
+ return articleContent;
1595
+ }
1596
+ }
1597
+ },
1598
+
1599
+ /**
1600
+ * Converts some of the common HTML entities in string to their corresponding characters.
1601
+ *
1602
+ * @param str {string} - a string to unescape.
1603
+ * @return string without HTML entity.
1604
+ */
1605
+ _unescapeHtmlEntities(str) {
1606
+ if (!str) {
1607
+ return str;
1608
+ }
1609
+
1610
+ var htmlEscapeMap = this.HTML_ESCAPE_MAP;
1611
+ return str
1612
+ .replace(/&(quot|amp|apos|lt|gt);/g, function (_, tag) {
1613
+ return htmlEscapeMap[tag];
1614
+ })
1615
+ .replace(/&#(?:x([0-9a-f]+)|([0-9]+));/gi, function (_, hex, numStr) {
1616
+ var num = parseInt(hex || numStr, hex ? 16 : 10);
1617
+
1618
+ // these character references are replaced by a conforming HTML parser
1619
+ if (num == 0 || num > 0x10ffff || (num >= 0xd800 && num <= 0xdfff)) {
1620
+ num = 0xfffd;
1621
+ }
1622
+
1623
+ return String.fromCodePoint(num);
1624
+ });
1625
+ },
1626
+
1627
+ /**
1628
+ * Try to extract metadata from JSON-LD object.
1629
+ * For now, only Schema.org objects of type Article or its subtypes are supported.
1630
+ * @return Object with any metadata that could be extracted (possibly none)
1631
+ */
1632
+ _getJSONLD(doc) {
1633
+ var scripts = this._getAllNodesWithTag(doc, ["script"]);
1634
+
1635
+ var metadata;
1636
+
1637
+ this._forEachNode(scripts, function (jsonLdElement) {
1638
+ if (
1639
+ !metadata &&
1640
+ jsonLdElement.getAttribute("type") === "application/ld+json"
1641
+ ) {
1642
+ try {
1643
+ // Strip CDATA markers if present
1644
+ var content = jsonLdElement.textContent.replace(
1645
+ /^\s*<!\[CDATA\[|\]\]>\s*$/g,
1646
+ ""
1647
+ );
1648
+ var parsed = JSON.parse(content);
1649
+
1650
+ if (Array.isArray(parsed)) {
1651
+ parsed = parsed.find(it => {
1652
+ return (
1653
+ it["@type"] &&
1654
+ it["@type"].match(this.REGEXPS.jsonLdArticleTypes)
1655
+ );
1656
+ });
1657
+ if (!parsed) {
1658
+ return;
1659
+ }
1660
+ }
1661
+
1662
+ var schemaDotOrgRegex = /^https?\:\/\/schema\.org\/?$/;
1663
+ var matches =
1664
+ (typeof parsed["@context"] === "string" &&
1665
+ parsed["@context"].match(schemaDotOrgRegex)) ||
1666
+ (typeof parsed["@context"] === "object" &&
1667
+ typeof parsed["@context"]["@vocab"] == "string" &&
1668
+ parsed["@context"]["@vocab"].match(schemaDotOrgRegex));
1669
+
1670
+ if (!matches) {
1671
+ return;
1672
+ }
1673
+
1674
+ if (!parsed["@type"] && Array.isArray(parsed["@graph"])) {
1675
+ parsed = parsed["@graph"].find(it => {
1676
+ return (it["@type"] || "").match(this.REGEXPS.jsonLdArticleTypes);
1677
+ });
1678
+ }
1679
+
1680
+ if (
1681
+ !parsed ||
1682
+ !parsed["@type"] ||
1683
+ !parsed["@type"].match(this.REGEXPS.jsonLdArticleTypes)
1684
+ ) {
1685
+ return;
1686
+ }
1687
+
1688
+ metadata = {};
1689
+
1690
+ if (
1691
+ typeof parsed.name === "string" &&
1692
+ typeof parsed.headline === "string" &&
1693
+ parsed.name !== parsed.headline
1694
+ ) {
1695
+ // we have both name and headline element in the JSON-LD. They should both be the same but some websites like aktualne.cz
1696
+ // put their own name into "name" and the article title to "headline" which confuses Readability. So we try to check if either
1697
+ // "name" or "headline" closely matches the html title, and if so, use that one. If not, then we use "name" by default.
1698
+
1699
+ var title = this._getArticleTitle();
1700
+ var nameMatches = this._textSimilarity(parsed.name, title) > 0.75;
1701
+ var headlineMatches =
1702
+ this._textSimilarity(parsed.headline, title) > 0.75;
1703
+
1704
+ if (headlineMatches && !nameMatches) {
1705
+ metadata.title = parsed.headline;
1706
+ } else {
1707
+ metadata.title = parsed.name;
1708
+ }
1709
+ } else if (typeof parsed.name === "string") {
1710
+ metadata.title = parsed.name.trim();
1711
+ } else if (typeof parsed.headline === "string") {
1712
+ metadata.title = parsed.headline.trim();
1713
+ }
1714
+ if (parsed.author) {
1715
+ if (typeof parsed.author.name === "string") {
1716
+ metadata.byline = parsed.author.name.trim();
1717
+ } else if (
1718
+ Array.isArray(parsed.author) &&
1719
+ parsed.author[0] &&
1720
+ typeof parsed.author[0].name === "string"
1721
+ ) {
1722
+ metadata.byline = parsed.author
1723
+ .filter(function (author) {
1724
+ return author && typeof author.name === "string";
1725
+ })
1726
+ .map(function (author) {
1727
+ return author.name.trim();
1728
+ })
1729
+ .join(", ");
1730
+ }
1731
+ }
1732
+ if (typeof parsed.description === "string") {
1733
+ metadata.excerpt = parsed.description.trim();
1734
+ }
1735
+ if (parsed.publisher && typeof parsed.publisher.name === "string") {
1736
+ metadata.siteName = parsed.publisher.name.trim();
1737
+ }
1738
+ if (typeof parsed.datePublished === "string") {
1739
+ metadata.datePublished = parsed.datePublished.trim();
1740
+ }
1741
+ } catch (err) {
1742
+ this.log(err.message);
1743
+ }
1744
+ }
1745
+ });
1746
+ return metadata ? metadata : {};
1747
+ },
1748
+
1749
+ /**
1750
+ * Attempts to get excerpt and byline metadata for the article.
1751
+ *
1752
+ * @param {Object} jsonld — object containing any metadata that
1753
+ * could be extracted from JSON-LD object.
1754
+ *
1755
+ * @return Object with optional "excerpt" and "byline" properties
1756
+ */
1757
+ _getArticleMetadata(jsonld) {
1758
+ var metadata = {};
1759
+ var values = {};
1760
+ var metaElements = this._doc.getElementsByTagName("meta");
1761
+
1762
+ // property is a space-separated list of values
1763
+ var propertyPattern =
1764
+ /\s*(article|dc|dcterm|og|twitter)\s*:\s*(author|creator|description|published_time|title|site_name)\s*/gi;
1765
+
1766
+ // name is a single value
1767
+ var namePattern =
1768
+ /^\s*(?:(dc|dcterm|og|twitter|parsely|weibo:(article|webpage))\s*[-\.:]\s*)?(author|creator|pub-date|description|title|site_name)\s*$/i;
1769
+
1770
+ // Find description tags.
1771
+ this._forEachNode(metaElements, function (element) {
1772
+ var elementName = element.getAttribute("name");
1773
+ var elementProperty = element.getAttribute("property");
1774
+ var content = element.getAttribute("content");
1775
+ if (!content) {
1776
+ return;
1777
+ }
1778
+ var matches = null;
1779
+ var name = null;
1780
+
1781
+ if (elementProperty) {
1782
+ matches = elementProperty.match(propertyPattern);
1783
+ if (matches) {
1784
+ // Convert to lowercase, and remove any whitespace
1785
+ // so we can match below.
1786
+ name = matches[0].toLowerCase().replace(/\s/g, "");
1787
+ // multiple authors
1788
+ values[name] = content.trim();
1789
+ }
1790
+ }
1791
+ if (!matches && elementName && namePattern.test(elementName)) {
1792
+ name = elementName;
1793
+ if (content) {
1794
+ // Convert to lowercase, remove any whitespace, and convert dots
1795
+ // to colons so we can match below.
1796
+ name = name.toLowerCase().replace(/\s/g, "").replace(/\./g, ":");
1797
+ values[name] = content.trim();
1798
+ }
1799
+ }
1800
+ });
1801
+
1802
+ // get title
1803
+ metadata.title =
1804
+ jsonld.title ||
1805
+ values["dc:title"] ||
1806
+ values["dcterm:title"] ||
1807
+ values["og:title"] ||
1808
+ values["weibo:article:title"] ||
1809
+ values["weibo:webpage:title"] ||
1810
+ values.title ||
1811
+ values["twitter:title"] ||
1812
+ values["parsely-title"];
1813
+
1814
+ if (!metadata.title) {
1815
+ metadata.title = this._getArticleTitle();
1816
+ }
1817
+
1818
+ const articleAuthor =
1819
+ typeof values["article:author"] === "string" &&
1820
+ !this._isUrl(values["article:author"])
1821
+ ? values["article:author"]
1822
+ : undefined;
1823
+
1824
+ // get author
1825
+ metadata.byline =
1826
+ jsonld.byline ||
1827
+ values["dc:creator"] ||
1828
+ values["dcterm:creator"] ||
1829
+ values.author ||
1830
+ values["parsely-author"] ||
1831
+ articleAuthor;
1832
+
1833
+ // get description
1834
+ metadata.excerpt =
1835
+ jsonld.excerpt ||
1836
+ values["dc:description"] ||
1837
+ values["dcterm:description"] ||
1838
+ values["og:description"] ||
1839
+ values["weibo:article:description"] ||
1840
+ values["weibo:webpage:description"] ||
1841
+ values.description ||
1842
+ values["twitter:description"];
1843
+
1844
+ // get site name
1845
+ metadata.siteName = jsonld.siteName || values["og:site_name"];
1846
+
1847
+ // get article published time
1848
+ metadata.publishedTime =
1849
+ jsonld.datePublished ||
1850
+ values["article:published_time"] ||
1851
+ values["parsely-pub-date"] ||
1852
+ null;
1853
+
1854
+ // in many sites the meta value is escaped with HTML entities,
1855
+ // so here we need to unescape it
1856
+ metadata.title = this._unescapeHtmlEntities(metadata.title);
1857
+ metadata.byline = this._unescapeHtmlEntities(metadata.byline);
1858
+ metadata.excerpt = this._unescapeHtmlEntities(metadata.excerpt);
1859
+ metadata.siteName = this._unescapeHtmlEntities(metadata.siteName);
1860
+ metadata.publishedTime = this._unescapeHtmlEntities(metadata.publishedTime);
1861
+
1862
+ return metadata;
1863
+ },
1864
+
1865
+ /**
1866
+ * Check if node is image, or if node contains exactly only one image
1867
+ * whether as a direct child or as its descendants.
1868
+ *
1869
+ * @param Element
1870
+ **/
1871
+ _isSingleImage(node) {
1872
+ while (node) {
1873
+ if (node.tagName === "IMG") {
1874
+ return true;
1875
+ }
1876
+ if (node.children.length !== 1 || node.textContent.trim() !== "") {
1877
+ return false;
1878
+ }
1879
+ node = node.children[0];
1880
+ }
1881
+ return false;
1882
+ },
1883
+
1884
+ /**
1885
+ * Find all <noscript> that are located after <img> nodes, and which contain only one
1886
+ * <img> element. Replace the first image with the image from inside the <noscript> tag,
1887
+ * and remove the <noscript> tag. This improves the quality of the images we use on
1888
+ * some sites (e.g. Medium).
1889
+ *
1890
+ * @param Element
1891
+ **/
1892
+ _unwrapNoscriptImages(doc) {
1893
+ // Find img without source or attributes that might contains image, and remove it.
1894
+ // This is done to prevent a placeholder img is replaced by img from noscript in next step.
1895
+ var imgs = Array.from(doc.getElementsByTagName("img"));
1896
+ this._forEachNode(imgs, function (img) {
1897
+ for (var i = 0; i < img.attributes.length; i++) {
1898
+ var attr = img.attributes[i];
1899
+ switch (attr.name) {
1900
+ case "src":
1901
+ case "srcset":
1902
+ case "data-src":
1903
+ case "data-srcset":
1904
+ return;
1905
+ }
1906
+
1907
+ if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) {
1908
+ return;
1909
+ }
1910
+ }
1911
+
1912
+ img.remove();
1913
+ });
1914
+
1915
+ // Next find noscript and try to extract its image
1916
+ var noscripts = Array.from(doc.getElementsByTagName("noscript"));
1917
+ this._forEachNode(noscripts, function (noscript) {
1918
+ // Parse content of noscript and make sure it only contains image
1919
+ if (!this._isSingleImage(noscript)) {
1920
+ return;
1921
+ }
1922
+ var tmp = doc.createElement("div");
1923
+ // We're running in the document context, and using unmodified
1924
+ // document contents, so doing this should be safe.
1925
+ // (Also we heavily discourage people from allowing script to
1926
+ // run at all in this document...)
1927
+ // eslint-disable-next-line no-unsanitized/property
1928
+ tmp.innerHTML = noscript.innerHTML;
1929
+
1930
+ // If noscript has previous sibling and it only contains image,
1931
+ // replace it with noscript content. However we also keep old
1932
+ // attributes that might contains image.
1933
+ var prevElement = noscript.previousElementSibling;
1934
+ if (prevElement && this._isSingleImage(prevElement)) {
1935
+ var prevImg = prevElement;
1936
+ if (prevImg.tagName !== "IMG") {
1937
+ prevImg = prevElement.getElementsByTagName("img")[0];
1938
+ }
1939
+
1940
+ var newImg = tmp.getElementsByTagName("img")[0];
1941
+ for (var i = 0; i < prevImg.attributes.length; i++) {
1942
+ var attr = prevImg.attributes[i];
1943
+ if (attr.value === "") {
1944
+ continue;
1945
+ }
1946
+
1947
+ if (
1948
+ attr.name === "src" ||
1949
+ attr.name === "srcset" ||
1950
+ /\.(jpg|jpeg|png|webp)/i.test(attr.value)
1951
+ ) {
1952
+ if (newImg.getAttribute(attr.name) === attr.value) {
1953
+ continue;
1954
+ }
1955
+
1956
+ var attrName = attr.name;
1957
+ if (newImg.hasAttribute(attrName)) {
1958
+ attrName = "data-old-" + attrName;
1959
+ }
1960
+
1961
+ newImg.setAttribute(attrName, attr.value);
1962
+ }
1963
+ }
1964
+
1965
+ noscript.parentNode.replaceChild(tmp.firstElementChild, prevElement);
1966
+ }
1967
+ });
1968
+ },
1969
+
1970
+ /**
1971
+ * Removes script tags from the document.
1972
+ *
1973
+ * @param Element
1974
+ **/
1975
+ _removeScripts(doc) {
1976
+ this._removeNodes(this._getAllNodesWithTag(doc, ["script", "noscript"]));
1977
+ },
1978
+
1979
+ /**
1980
+ * Check if this node has only whitespace and a single element with given tag
1981
+ * Returns false if the DIV node contains non-empty text nodes
1982
+ * or if it contains no element with given tag or more than 1 element.
1983
+ *
1984
+ * @param Element
1985
+ * @param string tag of child element
1986
+ **/
1987
+ _hasSingleTagInsideElement(element, tag) {
1988
+ // There should be exactly 1 element child with given tag
1989
+ if (element.children.length != 1 || element.children[0].tagName !== tag) {
1990
+ return false;
1991
+ }
1992
+
1993
+ // And there should be no text nodes with real content
1994
+ return !this._someNode(element.childNodes, function (node) {
1995
+ return (
1996
+ node.nodeType === this.TEXT_NODE &&
1997
+ this.REGEXPS.hasContent.test(node.textContent)
1998
+ );
1999
+ });
2000
+ },
2001
+
2002
+ _isElementWithoutContent(node) {
2003
+ return (
2004
+ node.nodeType === this.ELEMENT_NODE &&
2005
+ !node.textContent.trim().length &&
2006
+ (!node.children.length ||
2007
+ node.children.length ==
2008
+ node.getElementsByTagName("br").length +
2009
+ node.getElementsByTagName("hr").length)
2010
+ );
2011
+ },
2012
+
2013
+ /**
2014
+ * Determine whether element has any children block level elements.
2015
+ *
2016
+ * @param Element
2017
+ */
2018
+ _hasChildBlockElement(element) {
2019
+ return this._someNode(element.childNodes, function (node) {
2020
+ return (
2021
+ this.DIV_TO_P_ELEMS.has(node.tagName) ||
2022
+ this._hasChildBlockElement(node)
2023
+ );
2024
+ });
2025
+ },
2026
+
2027
+ /***
2028
+ * Determine if a node qualifies as phrasing content.
2029
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
2030
+ **/
2031
+ _isPhrasingContent(node) {
2032
+ return (
2033
+ node.nodeType === this.TEXT_NODE ||
2034
+ this.PHRASING_ELEMS.includes(node.tagName) ||
2035
+ ((node.tagName === "A" ||
2036
+ node.tagName === "DEL" ||
2037
+ node.tagName === "INS") &&
2038
+ this._everyNode(node.childNodes, this._isPhrasingContent))
2039
+ );
2040
+ },
2041
+
2042
+ _isWhitespace(node) {
2043
+ return (
2044
+ (node.nodeType === this.TEXT_NODE &&
2045
+ node.textContent.trim().length === 0) ||
2046
+ (node.nodeType === this.ELEMENT_NODE && node.tagName === "BR")
2047
+ );
2048
+ },
2049
+
2050
+ /**
2051
+ * Get the inner text of a node - cross browser compatibly.
2052
+ * This also strips out any excess whitespace to be found.
2053
+ *
2054
+ * @param Element
2055
+ * @param Boolean normalizeSpaces (default: true)
2056
+ * @return string
2057
+ **/
2058
+ _getInnerText(e, normalizeSpaces) {
2059
+ normalizeSpaces =
2060
+ typeof normalizeSpaces === "undefined" ? true : normalizeSpaces;
2061
+ var textContent = e.textContent.trim();
2062
+
2063
+ if (normalizeSpaces) {
2064
+ return textContent.replace(this.REGEXPS.normalize, " ");
2065
+ }
2066
+ return textContent;
2067
+ },
2068
+
2069
+ /**
2070
+ * Get the number of times a string s appears in the node e.
2071
+ *
2072
+ * @param Element
2073
+ * @param string - what to split on. Default is ","
2074
+ * @return number (integer)
2075
+ **/
2076
+ _getCharCount(e, s) {
2077
+ s = s || ",";
2078
+ return this._getInnerText(e).split(s).length - 1;
2079
+ },
2080
+
2081
+ /**
2082
+ * Remove the style attribute on every e and under.
2083
+ * TODO: Test if getElementsByTagName(*) is faster.
2084
+ *
2085
+ * @param Element
2086
+ * @return void
2087
+ **/
2088
+ _cleanStyles(e) {
2089
+ if (!e || e.tagName.toLowerCase() === "svg") {
2090
+ return;
2091
+ }
2092
+
2093
+ // Remove `style` and deprecated presentational attributes
2094
+ for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) {
2095
+ e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]);
2096
+ }
2097
+
2098
+ if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.includes(e.tagName)) {
2099
+ e.removeAttribute("width");
2100
+ e.removeAttribute("height");
2101
+ }
2102
+
2103
+ var cur = e.firstElementChild;
2104
+ while (cur !== null) {
2105
+ this._cleanStyles(cur);
2106
+ cur = cur.nextElementSibling;
2107
+ }
2108
+ },
2109
+
2110
+ /**
2111
+ * Get the density of links as a percentage of the content
2112
+ * This is the amount of text that is inside a link divided by the total text in the node.
2113
+ *
2114
+ * @param Element
2115
+ * @return number (float)
2116
+ **/
2117
+ _getLinkDensity(element) {
2118
+ var textLength = this._getInnerText(element).length;
2119
+ if (textLength === 0) {
2120
+ return 0;
2121
+ }
2122
+
2123
+ var linkLength = 0;
2124
+
2125
+ // XXX implement _reduceNodeList?
2126
+ this._forEachNode(element.getElementsByTagName("a"), function (linkNode) {
2127
+ var href = linkNode.getAttribute("href");
2128
+ var coefficient = href && this.REGEXPS.hashUrl.test(href) ? 0.3 : 1;
2129
+ linkLength += this._getInnerText(linkNode).length * coefficient;
2130
+ });
2131
+
2132
+ return linkLength / textLength;
2133
+ },
2134
+
2135
+ /**
2136
+ * Get an elements class/id weight. Uses regular expressions to tell if this
2137
+ * element looks good or bad.
2138
+ *
2139
+ * @param Element
2140
+ * @return number (Integer)
2141
+ **/
2142
+ _getClassWeight(e) {
2143
+ if (!this._flagIsActive(this.FLAG_WEIGHT_CLASSES)) {
2144
+ return 0;
2145
+ }
2146
+
2147
+ var weight = 0;
2148
+
2149
+ // Look for a special classname
2150
+ if (typeof e.className === "string" && e.className !== "") {
2151
+ if (this.REGEXPS.negative.test(e.className)) {
2152
+ weight -= 25;
2153
+ }
2154
+
2155
+ if (this.REGEXPS.positive.test(e.className)) {
2156
+ weight += 25;
2157
+ }
2158
+ }
2159
+
2160
+ // Look for a special ID
2161
+ if (typeof e.id === "string" && e.id !== "") {
2162
+ if (this.REGEXPS.negative.test(e.id)) {
2163
+ weight -= 25;
2164
+ }
2165
+
2166
+ if (this.REGEXPS.positive.test(e.id)) {
2167
+ weight += 25;
2168
+ }
2169
+ }
2170
+
2171
+ return weight;
2172
+ },
2173
+
2174
+ /**
2175
+ * Clean a node of all elements of type "tag".
2176
+ * (Unless it's a youtube/vimeo video. People love movies.)
2177
+ *
2178
+ * @param Element
2179
+ * @param string tag to clean
2180
+ * @return void
2181
+ **/
2182
+ _clean(e, tag) {
2183
+ var isEmbed = ["object", "embed", "iframe"].includes(tag);
2184
+
2185
+ this._removeNodes(this._getAllNodesWithTag(e, [tag]), function (element) {
2186
+ // Allow youtube and vimeo videos through as people usually want to see those.
2187
+ if (isEmbed) {
2188
+ // First, check the elements attributes to see if any of them contain youtube or vimeo
2189
+ for (var i = 0; i < element.attributes.length; i++) {
2190
+ if (this._allowedVideoRegex.test(element.attributes[i].value)) {
2191
+ return false;
2192
+ }
2193
+ }
2194
+
2195
+ // For embed with <object> tag, check inner HTML as well.
2196
+ if (
2197
+ element.tagName === "object" &&
2198
+ this._allowedVideoRegex.test(element.innerHTML)
2199
+ ) {
2200
+ return false;
2201
+ }
2202
+ }
2203
+
2204
+ return true;
2205
+ });
2206
+ },
2207
+
2208
+ /**
2209
+ * Check if a given node has one of its ancestor tag name matching the
2210
+ * provided one.
2211
+ * @param HTMLElement node
2212
+ * @param String tagName
2213
+ * @param Number maxDepth
2214
+ * @param Function filterFn a filter to invoke to determine whether this node 'counts'
2215
+ * @return Boolean
2216
+ */
2217
+ _hasAncestorTag(node, tagName, maxDepth, filterFn) {
2218
+ maxDepth = maxDepth || 3;
2219
+ tagName = tagName.toUpperCase();
2220
+ var depth = 0;
2221
+ while (node.parentNode) {
2222
+ if (maxDepth > 0 && depth > maxDepth) {
2223
+ return false;
2224
+ }
2225
+ if (
2226
+ node.parentNode.tagName === tagName &&
2227
+ (!filterFn || filterFn(node.parentNode))
2228
+ ) {
2229
+ return true;
2230
+ }
2231
+ node = node.parentNode;
2232
+ depth++;
2233
+ }
2234
+ return false;
2235
+ },
2236
+
2237
+ /**
2238
+ * Return an object indicating how many rows and columns this table has.
2239
+ */
2240
+ _getRowAndColumnCount(table) {
2241
+ var rows = 0;
2242
+ var columns = 0;
2243
+ var trs = table.getElementsByTagName("tr");
2244
+ for (var i = 0; i < trs.length; i++) {
2245
+ var rowspan = trs[i].getAttribute("rowspan") || 0;
2246
+ if (rowspan) {
2247
+ rowspan = parseInt(rowspan, 10);
2248
+ }
2249
+ rows += rowspan || 1;
2250
+
2251
+ // Now look for column-related info
2252
+ var columnsInThisRow = 0;
2253
+ var cells = trs[i].getElementsByTagName("td");
2254
+ for (var j = 0; j < cells.length; j++) {
2255
+ var colspan = cells[j].getAttribute("colspan") || 0;
2256
+ if (colspan) {
2257
+ colspan = parseInt(colspan, 10);
2258
+ }
2259
+ columnsInThisRow += colspan || 1;
2260
+ }
2261
+ columns = Math.max(columns, columnsInThisRow);
2262
+ }
2263
+ return { rows, columns };
2264
+ },
2265
+
2266
+ /**
2267
+ * Look for 'data' (as opposed to 'layout') tables, for which we use
2268
+ * similar checks as
2269
+ * https://searchfox.org/mozilla-central/rev/f82d5c549f046cb64ce5602bfd894b7ae807c8f8/accessible/generic/TableAccessible.cpp#19
2270
+ */
2271
+ _markDataTables(root) {
2272
+ var tables = root.getElementsByTagName("table");
2273
+ for (var i = 0; i < tables.length; i++) {
2274
+ var table = tables[i];
2275
+ var role = table.getAttribute("role");
2276
+ if (role == "presentation") {
2277
+ table._readabilityDataTable = false;
2278
+ continue;
2279
+ }
2280
+ var datatable = table.getAttribute("datatable");
2281
+ if (datatable == "0") {
2282
+ table._readabilityDataTable = false;
2283
+ continue;
2284
+ }
2285
+ var summary = table.getAttribute("summary");
2286
+ if (summary) {
2287
+ table._readabilityDataTable = true;
2288
+ continue;
2289
+ }
2290
+
2291
+ var caption = table.getElementsByTagName("caption")[0];
2292
+ if (caption && caption.childNodes.length) {
2293
+ table._readabilityDataTable = true;
2294
+ continue;
2295
+ }
2296
+
2297
+ // If the table has a descendant with any of these tags, consider a data table:
2298
+ var dataTableDescendants = ["col", "colgroup", "tfoot", "thead", "th"];
2299
+ var descendantExists = function (tag) {
2300
+ return !!table.getElementsByTagName(tag)[0];
2301
+ };
2302
+ if (dataTableDescendants.some(descendantExists)) {
2303
+ this.log("Data table because found data-y descendant");
2304
+ table._readabilityDataTable = true;
2305
+ continue;
2306
+ }
2307
+
2308
+ // Nested tables indicate a layout table:
2309
+ if (table.getElementsByTagName("table")[0]) {
2310
+ table._readabilityDataTable = false;
2311
+ continue;
2312
+ }
2313
+
2314
+ var sizeInfo = this._getRowAndColumnCount(table);
2315
+
2316
+ if (sizeInfo.columns == 1 || sizeInfo.rows == 1) {
2317
+ // single colum/row tables are commonly used for page layout purposes.
2318
+ table._readabilityDataTable = false;
2319
+ continue;
2320
+ }
2321
+
2322
+ if (sizeInfo.rows >= 10 || sizeInfo.columns > 4) {
2323
+ table._readabilityDataTable = true;
2324
+ continue;
2325
+ }
2326
+ // Now just go by size entirely:
2327
+ table._readabilityDataTable = sizeInfo.rows * sizeInfo.columns > 10;
2328
+ }
2329
+ },
2330
+
2331
+ /* convert images and figures that have properties like data-src into images that can be loaded without JS */
2332
+ _fixLazyImages(root) {
2333
+ this._forEachNode(
2334
+ this._getAllNodesWithTag(root, ["img", "picture", "figure"]),
2335
+ function (elem) {
2336
+ // In some sites (e.g. Kotaku), they put 1px square image as base64 data uri in the src attribute.
2337
+ // So, here we check if the data uri is too short, just might as well remove it.
2338
+ if (elem.src && this.REGEXPS.b64DataUrl.test(elem.src)) {
2339
+ // Make sure it's not SVG, because SVG can have a meaningful image in under 133 bytes.
2340
+ var parts = this.REGEXPS.b64DataUrl.exec(elem.src);
2341
+ if (parts[1] === "image/svg+xml") {
2342
+ return;
2343
+ }
2344
+
2345
+ // Make sure this element has other attributes which contains image.
2346
+ // If it doesn't, then this src is important and shouldn't be removed.
2347
+ var srcCouldBeRemoved = false;
2348
+ for (var i = 0; i < elem.attributes.length; i++) {
2349
+ var attr = elem.attributes[i];
2350
+ if (attr.name === "src") {
2351
+ continue;
2352
+ }
2353
+
2354
+ if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) {
2355
+ srcCouldBeRemoved = true;
2356
+ break;
2357
+ }
2358
+ }
2359
+
2360
+ // Here we assume if image is less than 100 bytes (or 133 after encoded to base64)
2361
+ // it will be too small, therefore it might be placeholder image.
2362
+ if (srcCouldBeRemoved) {
2363
+ var b64starts = parts[0].length;
2364
+ var b64length = elem.src.length - b64starts;
2365
+ if (b64length < 133) {
2366
+ elem.removeAttribute("src");
2367
+ }
2368
+ }
2369
+ }
2370
+
2371
+ // also check for "null" to work around https://github.com/jsdom/jsdom/issues/2580
2372
+ if (
2373
+ (elem.src || (elem.srcset && elem.srcset != "null")) &&
2374
+ !elem.className.toLowerCase().includes("lazy")
2375
+ ) {
2376
+ return;
2377
+ }
2378
+
2379
+ for (var j = 0; j < elem.attributes.length; j++) {
2380
+ attr = elem.attributes[j];
2381
+ if (
2382
+ attr.name === "src" ||
2383
+ attr.name === "srcset" ||
2384
+ attr.name === "alt"
2385
+ ) {
2386
+ continue;
2387
+ }
2388
+ var copyTo = null;
2389
+ if (/\.(jpg|jpeg|png|webp)\s+\d/.test(attr.value)) {
2390
+ copyTo = "srcset";
2391
+ } else if (/^\s*\S+\.(jpg|jpeg|png|webp)\S*\s*$/.test(attr.value)) {
2392
+ copyTo = "src";
2393
+ }
2394
+ if (copyTo) {
2395
+ //if this is an img or picture, set the attribute directly
2396
+ if (elem.tagName === "IMG" || elem.tagName === "PICTURE") {
2397
+ elem.setAttribute(copyTo, attr.value);
2398
+ } else if (
2399
+ elem.tagName === "FIGURE" &&
2400
+ !this._getAllNodesWithTag(elem, ["img", "picture"]).length
2401
+ ) {
2402
+ //if the item is a <figure> that does not contain an image or picture, create one and place it inside the figure
2403
+ //see the nytimes-3 testcase for an example
2404
+ var img = this._doc.createElement("img");
2405
+ img.setAttribute(copyTo, attr.value);
2406
+ elem.appendChild(img);
2407
+ }
2408
+ }
2409
+ }
2410
+ }
2411
+ );
2412
+ },
2413
+
2414
+ _getTextDensity(e, tags) {
2415
+ var textLength = this._getInnerText(e, true).length;
2416
+ if (textLength === 0) {
2417
+ return 0;
2418
+ }
2419
+ var childrenLength = 0;
2420
+ var children = this._getAllNodesWithTag(e, tags);
2421
+ this._forEachNode(
2422
+ children,
2423
+ child => (childrenLength += this._getInnerText(child, true).length)
2424
+ );
2425
+ return childrenLength / textLength;
2426
+ },
2427
+
2428
+ /**
2429
+ * Clean an element of all tags of type "tag" if they look fishy.
2430
+ * "Fishy" is an algorithm based on content length, classnames, link density, number of images & embeds, etc.
2431
+ *
2432
+ * @return void
2433
+ **/
2434
+ _cleanConditionally(e, tag) {
2435
+ if (!this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)) {
2436
+ return;
2437
+ }
2438
+
2439
+ // Gather counts for other typical elements embedded within.
2440
+ // Traverse backwards so we can remove nodes at the same time
2441
+ // without effecting the traversal.
2442
+ //
2443
+ // TODO: Consider taking into account original contentScore here.
2444
+ this._removeNodes(this._getAllNodesWithTag(e, [tag]), function (node) {
2445
+ // First check if this node IS data table, in which case don't remove it.
2446
+ var isDataTable = function (t) {
2447
+ return t._readabilityDataTable;
2448
+ };
2449
+
2450
+ var isList = tag === "ul" || tag === "ol";
2451
+ if (!isList) {
2452
+ var listLength = 0;
2453
+ var listNodes = this._getAllNodesWithTag(node, ["ul", "ol"]);
2454
+ this._forEachNode(
2455
+ listNodes,
2456
+ list => (listLength += this._getInnerText(list).length)
2457
+ );
2458
+ isList = listLength / this._getInnerText(node).length > 0.9;
2459
+ }
2460
+
2461
+ if (tag === "table" && isDataTable(node)) {
2462
+ return false;
2463
+ }
2464
+
2465
+ // Next check if we're inside a data table, in which case don't remove it as well.
2466
+ if (this._hasAncestorTag(node, "table", -1, isDataTable)) {
2467
+ return false;
2468
+ }
2469
+
2470
+ if (this._hasAncestorTag(node, "code")) {
2471
+ return false;
2472
+ }
2473
+
2474
+ // keep element if it has a data tables
2475
+ if (
2476
+ [...node.getElementsByTagName("table")].some(
2477
+ tbl => tbl._readabilityDataTable
2478
+ )
2479
+ ) {
2480
+ return false;
2481
+ }
2482
+
2483
+ var weight = this._getClassWeight(node);
2484
+
2485
+ this.log("Cleaning Conditionally", node);
2486
+
2487
+ var contentScore = 0;
2488
+
2489
+ if (weight + contentScore < 0) {
2490
+ return true;
2491
+ }
2492
+
2493
+ if (this._getCharCount(node, ",") < 10) {
2494
+ // If there are not very many commas, and the number of
2495
+ // non-paragraph elements is more than paragraphs or other
2496
+ // ominous signs, remove the element.
2497
+ var p = node.getElementsByTagName("p").length;
2498
+ var img = node.getElementsByTagName("img").length;
2499
+ var li = node.getElementsByTagName("li").length - 100;
2500
+ var input = node.getElementsByTagName("input").length;
2501
+ var headingDensity = this._getTextDensity(node, [
2502
+ "h1",
2503
+ "h2",
2504
+ "h3",
2505
+ "h4",
2506
+ "h5",
2507
+ "h6",
2508
+ ]);
2509
+
2510
+ var embedCount = 0;
2511
+ var embeds = this._getAllNodesWithTag(node, [
2512
+ "object",
2513
+ "embed",
2514
+ "iframe",
2515
+ ]);
2516
+
2517
+ for (var i = 0; i < embeds.length; i++) {
2518
+ // If this embed has attribute that matches video regex, don't delete it.
2519
+ for (var j = 0; j < embeds[i].attributes.length; j++) {
2520
+ if (this._allowedVideoRegex.test(embeds[i].attributes[j].value)) {
2521
+ return false;
2522
+ }
2523
+ }
2524
+
2525
+ // For embed with <object> tag, check inner HTML as well.
2526
+ if (
2527
+ embeds[i].tagName === "object" &&
2528
+ this._allowedVideoRegex.test(embeds[i].innerHTML)
2529
+ ) {
2530
+ return false;
2531
+ }
2532
+
2533
+ embedCount++;
2534
+ }
2535
+
2536
+ var innerText = this._getInnerText(node);
2537
+
2538
+ // toss any node whose inner text contains nothing but suspicious words
2539
+ if (
2540
+ this.REGEXPS.adWords.test(innerText) ||
2541
+ this.REGEXPS.loadingWords.test(innerText)
2542
+ ) {
2543
+ return true;
2544
+ }
2545
+
2546
+ var contentLength = innerText.length;
2547
+ var linkDensity = this._getLinkDensity(node);
2548
+ var textishTags = ["SPAN", "LI", "TD"].concat(
2549
+ Array.from(this.DIV_TO_P_ELEMS)
2550
+ );
2551
+ var textDensity = this._getTextDensity(node, textishTags);
2552
+ var isFigureChild = this._hasAncestorTag(node, "figure");
2553
+
2554
+ // apply shadiness checks, then check for exceptions
2555
+ const shouldRemoveNode = () => {
2556
+ const errs = [];
2557
+ if (!isFigureChild && img > 1 && p / img < 0.5) {
2558
+ errs.push(`Bad p to img ratio (img=${img}, p=${p})`);
2559
+ }
2560
+ if (!isList && li > p) {
2561
+ errs.push(`Too many li's outside of a list. (li=${li} > p=${p})`);
2562
+ }
2563
+ if (input > Math.floor(p / 3)) {
2564
+ errs.push(`Too many inputs per p. (input=${input}, p=${p})`);
2565
+ }
2566
+ if (
2567
+ !isList &&
2568
+ !isFigureChild &&
2569
+ headingDensity < 0.9 &&
2570
+ contentLength < 25 &&
2571
+ (img === 0 || img > 2) &&
2572
+ linkDensity > 0
2573
+ ) {
2574
+ errs.push(
2575
+ `Suspiciously short. (headingDensity=${headingDensity}, img=${img}, linkDensity=${linkDensity})`
2576
+ );
2577
+ }
2578
+ if (
2579
+ !isList &&
2580
+ weight < 25 &&
2581
+ linkDensity > 0.2 + this._linkDensityModifier
2582
+ ) {
2583
+ errs.push(
2584
+ `Low weight and a little linky. (linkDensity=${linkDensity})`
2585
+ );
2586
+ }
2587
+ if (weight >= 25 && linkDensity > 0.5 + this._linkDensityModifier) {
2588
+ errs.push(
2589
+ `High weight and mostly links. (linkDensity=${linkDensity})`
2590
+ );
2591
+ }
2592
+ if ((embedCount === 1 && contentLength < 75) || embedCount > 1) {
2593
+ errs.push(
2594
+ `Suspicious embed. (embedCount=${embedCount}, contentLength=${contentLength})`
2595
+ );
2596
+ }
2597
+ if (img === 0 && textDensity === 0) {
2598
+ errs.push(
2599
+ `No useful content. (img=${img}, textDensity=${textDensity})`
2600
+ );
2601
+ }
2602
+
2603
+ if (errs.length) {
2604
+ this.log("Checks failed", errs);
2605
+ return true;
2606
+ }
2607
+
2608
+ return false;
2609
+ };
2610
+
2611
+ var haveToRemove = shouldRemoveNode();
2612
+
2613
+ // Allow simple lists of images to remain in pages
2614
+ if (isList && haveToRemove) {
2615
+ for (var x = 0; x < node.children.length; x++) {
2616
+ let child = node.children[x];
2617
+ // Don't filter in lists with li's that contain more than one child
2618
+ if (child.children.length > 1) {
2619
+ return haveToRemove;
2620
+ }
2621
+ }
2622
+ let li_count = node.getElementsByTagName("li").length;
2623
+ // Only allow the list to remain if every li contains an image
2624
+ if (img == li_count) {
2625
+ return false;
2626
+ }
2627
+ }
2628
+ return haveToRemove;
2629
+ }
2630
+ return false;
2631
+ });
2632
+ },
2633
+
2634
+ /**
2635
+ * Clean out elements that match the specified conditions
2636
+ *
2637
+ * @param Element
2638
+ * @param Function determines whether a node should be removed
2639
+ * @return void
2640
+ **/
2641
+ _cleanMatchedNodes(e, filter) {
2642
+ var endOfSearchMarkerNode = this._getNextNode(e, true);
2643
+ var next = this._getNextNode(e);
2644
+ while (next && next != endOfSearchMarkerNode) {
2645
+ if (filter.call(this, next, next.className + " " + next.id)) {
2646
+ next = this._removeAndGetNext(next);
2647
+ } else {
2648
+ next = this._getNextNode(next);
2649
+ }
2650
+ }
2651
+ },
2652
+
2653
+ /**
2654
+ * Clean out spurious headers from an Element.
2655
+ *
2656
+ * @param Element
2657
+ * @return void
2658
+ **/
2659
+ _cleanHeaders(e) {
2660
+ let headingNodes = this._getAllNodesWithTag(e, ["h1", "h2"]);
2661
+ this._removeNodes(headingNodes, function (node) {
2662
+ let shouldRemove = this._getClassWeight(node) < 0;
2663
+ if (shouldRemove) {
2664
+ this.log("Removing header with low class weight:", node);
2665
+ }
2666
+ return shouldRemove;
2667
+ });
2668
+ },
2669
+
2670
+ /**
2671
+ * Check if this node is an H1 or H2 element whose content is mostly
2672
+ * the same as the article title.
2673
+ *
2674
+ * @param Element the node to check.
2675
+ * @return boolean indicating whether this is a title-like header.
2676
+ */
2677
+ _headerDuplicatesTitle(node) {
2678
+ if (node.tagName != "H1" && node.tagName != "H2") {
2679
+ return false;
2680
+ }
2681
+ var heading = this._getInnerText(node, false);
2682
+ this.log("Evaluating similarity of header:", heading, this._articleTitle);
2683
+ return this._textSimilarity(this._articleTitle, heading) > 0.75;
2684
+ },
2685
+
2686
+ _flagIsActive(flag) {
2687
+ return (this._flags & flag) > 0;
2688
+ },
2689
+
2690
+ _removeFlag(flag) {
2691
+ this._flags = this._flags & ~flag;
2692
+ },
2693
+
2694
+ _isProbablyVisible(node) {
2695
+ // Have to null-check node.style and node.className.includes to deal with SVG and MathML nodes.
2696
+ return (
2697
+ (!node.style || node.style.display != "none") &&
2698
+ (!node.style || node.style.visibility != "hidden") &&
2699
+ !node.hasAttribute("hidden") &&
2700
+ //check for "fallback-image" so that wikimedia math images are displayed
2701
+ (!node.hasAttribute("aria-hidden") ||
2702
+ node.getAttribute("aria-hidden") != "true" ||
2703
+ (node.className &&
2704
+ node.className.includes &&
2705
+ node.className.includes("fallback-image")))
2706
+ );
2707
+ },
2708
+
2709
+ /**
2710
+ * Runs readability.
2711
+ *
2712
+ * Workflow:
2713
+ * 1. Prep the document by removing script tags, css, etc.
2714
+ * 2. Build readability's DOM tree.
2715
+ * 3. Grab the article content from the current dom tree.
2716
+ * 4. Replace the current DOM tree with the new one.
2717
+ * 5. Read peacefully.
2718
+ *
2719
+ * @return void
2720
+ **/
2721
+ parse() {
2722
+ // Avoid parsing too large documents, as per configuration option
2723
+ if (this._maxElemsToParse > 0) {
2724
+ var numTags = this._doc.getElementsByTagName("*").length;
2725
+ if (numTags > this._maxElemsToParse) {
2726
+ throw new Error(
2727
+ "Aborting parsing document; " + numTags + " elements found"
2728
+ );
2729
+ }
2730
+ }
2731
+
2732
+ // Unwrap image from noscript
2733
+ this._unwrapNoscriptImages(this._doc);
2734
+
2735
+ // Extract JSON-LD metadata before removing scripts
2736
+ var jsonLd = this._disableJSONLD ? {} : this._getJSONLD(this._doc);
2737
+
2738
+ // Remove script tags from the document.
2739
+ this._removeScripts(this._doc);
2740
+
2741
+ this._prepDocument();
2742
+
2743
+ var metadata = this._getArticleMetadata(jsonLd);
2744
+ this._metadata = metadata;
2745
+ this._articleTitle = metadata.title;
2746
+
2747
+ var articleContent = this._grabArticle();
2748
+ if (!articleContent) {
2749
+ return null;
2750
+ }
2751
+
2752
+ this.log("Grabbed: " + articleContent.innerHTML);
2753
+
2754
+ this._postProcessContent(articleContent);
2755
+
2756
+ // If we haven't found an excerpt in the article's metadata, use the article's
2757
+ // first paragraph as the excerpt. This is used for displaying a preview of
2758
+ // the article's content.
2759
+ if (!metadata.excerpt) {
2760
+ var paragraphs = articleContent.getElementsByTagName("p");
2761
+ if (paragraphs.length) {
2762
+ metadata.excerpt = paragraphs[0].textContent.trim();
2763
+ }
2764
+ }
2765
+
2766
+ var textContent = articleContent.textContent;
2767
+ return {
2768
+ title: this._articleTitle,
2769
+ byline: metadata.byline || this._articleByline,
2770
+ dir: this._articleDir,
2771
+ lang: this._articleLang,
2772
+ content: this._serializer(articleContent),
2773
+ textContent,
2774
+ length: textContent.length,
2775
+ excerpt: metadata.excerpt,
2776
+ siteName: metadata.siteName || this._articleSiteName,
2777
+ publishedTime: metadata.publishedTime,
2778
+ };
2779
+ },
2780
+ };
2781
+
2782
+ if (typeof module === "object") {
2783
+ /* eslint-disable-next-line no-redeclare */
2784
+ /* global module */
2785
+ module.exports = Readability;
2786
+ }