diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43ba814 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +readability-server/node_modules +news diff --git a/news b/news deleted file mode 100755 index dcac4ee..0000000 Binary files a/news and /dev/null differ diff --git a/readability-server/node_modules/.bin/acorn b/readability-server/node_modules/.bin/acorn deleted file mode 120000 index cf76760..0000000 --- a/readability-server/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/readability-server/node_modules/.bin/escodegen b/readability-server/node_modules/.bin/escodegen deleted file mode 120000 index 01a7c32..0000000 --- a/readability-server/node_modules/.bin/escodegen +++ /dev/null @@ -1 +0,0 @@ -../escodegen/bin/escodegen.js \ No newline at end of file diff --git a/readability-server/node_modules/.bin/esgenerate b/readability-server/node_modules/.bin/esgenerate deleted file mode 120000 index 7d0293e..0000000 --- a/readability-server/node_modules/.bin/esgenerate +++ /dev/null @@ -1 +0,0 @@ -../escodegen/bin/esgenerate.js \ No newline at end of file diff --git a/readability-server/node_modules/.bin/esparse b/readability-server/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/readability-server/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/readability-server/node_modules/.bin/esvalidate b/readability-server/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/readability-server/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/readability-server/node_modules/.bin/sshpk-conv b/readability-server/node_modules/.bin/sshpk-conv deleted file mode 120000 index a2a295c..0000000 --- a/readability-server/node_modules/.bin/sshpk-conv +++ /dev/null @@ -1 +0,0 @@ -../sshpk/bin/sshpk-conv \ No newline at end of file diff --git a/readability-server/node_modules/.bin/sshpk-sign b/readability-server/node_modules/.bin/sshpk-sign deleted file mode 120000 index 766b9b3..0000000 --- a/readability-server/node_modules/.bin/sshpk-sign +++ /dev/null @@ -1 +0,0 @@ -../sshpk/bin/sshpk-sign \ No newline at end of file diff --git a/readability-server/node_modules/.bin/sshpk-verify b/readability-server/node_modules/.bin/sshpk-verify deleted file mode 120000 index bfd7e3a..0000000 --- a/readability-server/node_modules/.bin/sshpk-verify +++ /dev/null @@ -1 +0,0 @@ -../sshpk/bin/sshpk-verify \ No newline at end of file diff --git a/readability-server/node_modules/.bin/uuid b/readability-server/node_modules/.bin/uuid deleted file mode 120000 index b3e45bc..0000000 --- a/readability-server/node_modules/.bin/uuid +++ /dev/null @@ -1 +0,0 @@ -../uuid/bin/uuid \ No newline at end of file diff --git a/readability-server/node_modules/.yarn-integrity b/readability-server/node_modules/.yarn-integrity deleted file mode 100644 index 3d823e6..0000000 --- a/readability-server/node_modules/.yarn-integrity +++ /dev/null @@ -1,128 +0,0 @@ -{ - "systemParams": "darwin-x64-83", - "modulesFolders": [ - "node_modules" - ], - "flags": [], - "linkedModules": [], - "topLevelPatterns": [ - "@mozilla/readability@^0.3.0", - "dompurify@^2.2.2", - "jsdom@^16.4.0", - "node-fetch@^2.6.1" - ], - "lockfileEntries": { - "@mozilla/readability@^0.3.0": "https://registry.yarnpkg.com/@mozilla/readability/-/readability-0.3.0.tgz#a473790e8b42ea39f9f03703fa1f17fec7984b60", - "abab@^2.0.3": "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a", - "acorn-globals@^6.0.0": "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45", - "acorn-walk@^7.1.1": "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc", - "acorn@^7.1.1": "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa", - "ajv@^6.12.3": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4", - "asn1@~0.2.3": "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136", - "assert-plus@1.0.0": "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "assert-plus@^1.0.0": "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "asynckit@^0.4.0": "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79", - "aws-sign2@~0.7.0": "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8", - "aws4@^1.8.0": "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59", - "bcrypt-pbkdf@^1.0.0": "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e", - "browser-process-hrtime@^1.0.0": "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626", - "caseless@~0.12.0": "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc", - "combined-stream@^1.0.6": "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f", - "combined-stream@~1.0.6": "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f", - "core-util-is@1.0.2": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "cssom@^0.4.4": "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10", - "cssom@~0.3.6": "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a", - "cssstyle@^2.2.0": "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852", - "dashdash@^1.12.0": "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0", - "data-urls@^2.0.0": "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b", - "decimal.js@^10.2.0": "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.2.1.tgz#238ae7b0f0c793d3e3cea410108b35a2c01426a3", - "deep-is@~0.1.3": "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34", - "delayed-stream@~1.0.0": "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619", - "domexception@^2.0.1": "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304", - "dompurify@^2.2.2": "https://registry.yarnpkg.com/dompurify/-/dompurify-2.2.2.tgz#cb8c2b1a2f3c8a0b565127504ae4eedec176a972", - "ecc-jsbn@~0.1.1": "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9", - "escodegen@^1.14.1": "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503", - "esprima@^4.0.1": "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71", - "estraverse@^4.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d", - "esutils@^2.0.2": "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64", - "extend@~3.0.2": "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa", - "extsprintf@1.3.0": "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05", - "extsprintf@^1.2.0": "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f", - "fast-deep-equal@^3.1.1": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525", - "fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633", - "fast-levenshtein@~2.0.6": "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917", - "forever-agent@~0.6.1": "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "form-data@~2.3.2": "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6", - "getpass@^0.1.1": "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa", - "har-schema@^2.0.0": "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92", - "har-validator@~5.1.3": "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd", - "html-encoding-sniffer@^2.0.1": "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz#42a6dc4fd33f00281176e8b23759ca4e4fa185f3", - "http-signature@~1.2.0": "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1", - "iconv-lite@0.4.24": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b", - "ip-regex@^2.1.0": "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9", - "is-potential-custom-element-name@^1.0.0": "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397", - "is-typedarray@~1.0.0": "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a", - "isstream@~0.1.2": "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a", - "jsbn@~0.1.0": "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513", - "jsdom@^16.4.0": "https://registry.yarnpkg.com/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb", - "json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660", - "json-schema@0.2.3": "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13", - "json-stringify-safe@~5.0.1": "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "jsprim@^1.2.2": "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2", - "levn@~0.3.0": "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee", - "lodash.sortby@^4.7.0": "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438", - "lodash@^4.17.19": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52", - "mime-db@1.44.0": "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92", - "mime-types@^2.1.12": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f", - "mime-types@~2.1.19": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f", - "node-fetch@^2.6.1": "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052", - "nwsapi@^2.2.0": "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7", - "oauth-sign@~0.9.0": "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455", - "optionator@^0.8.1": "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495", - "parse5@5.1.1": "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178", - "performance-now@^2.1.0": "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b", - "prelude-ls@~1.1.2": "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54", - "psl@^1.1.28": "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24", - "punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec", - "punycode@^2.1.1": "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec", - "qs@~6.5.2": "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36", - "request-promise-core@1.1.4": "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f", - "request-promise-native@^1.0.8": "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28", - "request@^2.88.2": "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3", - "safe-buffer@^5.0.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", - "safe-buffer@^5.1.2": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", - "safer-buffer@>= 2.1.2 < 3": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "safer-buffer@^2.0.2": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "safer-buffer@^2.1.0": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "safer-buffer@~2.1.0": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "saxes@^5.0.0": "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d", - "source-map@~0.6.1": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263", - "sshpk@^1.7.0": "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877", - "stealthy-require@^1.1.1": "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b", - "symbol-tree@^3.2.4": "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2", - "tough-cookie@^2.3.3": "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2", - "tough-cookie@^3.0.1": "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2", - "tough-cookie@~2.5.0": "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2", - "tr46@^2.0.2": "https://registry.yarnpkg.com/tr46/-/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479", - "tunnel-agent@^0.6.0": "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd", - "tweetnacl@^0.14.3": "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64", - "tweetnacl@~0.14.0": "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64", - "type-check@~0.3.2": "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72", - "uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602", - "uuid@^3.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee", - "verror@1.10.0": "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400", - "w3c-hr-time@^1.0.2": "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd", - "w3c-xmlserializer@^2.0.0": "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz#3e7104a05b75146cc60f564380b7f683acf1020a", - "webidl-conversions@^5.0.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff", - "webidl-conversions@^6.1.0": "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514", - "whatwg-encoding@^1.0.5": "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0", - "whatwg-mimetype@^2.3.0": "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf", - "whatwg-url@^8.0.0": "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.4.0.tgz#50fb9615b05469591d2b2bd6dfaed2942ed72837", - "word-wrap@~1.2.3": "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c", - "ws@^7.2.3": "https://registry.yarnpkg.com/ws/-/ws-7.4.0.tgz#a5dd76a24197940d4a8bb9e0e152bb4503764da7", - "xml-name-validator@^3.0.0": "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a", - "xmlchars@^2.2.0": "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" - }, - "files": [], - "artifacts": {} -} \ No newline at end of file diff --git a/readability-server/node_modules/@mozilla/readability/.eslintrc.js b/readability-server/node_modules/@mozilla/readability/.eslintrc.js deleted file mode 100644 index 117e6ca..0000000 --- a/readability-server/node_modules/@mozilla/readability/.eslintrc.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict"; - -module.exports = { - "parserOptions": { - "ecmaVersion": 6 - }, - "rules": { - // Braces only needed for multi-line arrow function blocks - // "arrow-body-style": [2, "as-needed"], - - // Require spacing around => - // "arrow-spacing": 2, - - // Always require spacing around a single line block - // "block-spacing": 1, - - // No newline before open brace for a block - "brace-style": 2, - - // No space before always a space after a comma - "comma-spacing": [2, {"before": false, "after": true}], - - // Commas at the end of the line not the start - // "comma-style": 2, - - // Don't require spaces around computed properties - // "computed-property-spacing": [2, "never"], - - // Functions must always return something or nothing - "consistent-return": 2, - - // Require braces around blocks that start a new line - // Note that this rule is likely to be overridden on a per-directory basis - // very frequently. - // "curly": [2, "multi-line"], - - // Always require a trailing EOL - "eol-last": 2, - - // Require function* name() - // "generator-star-spacing": [2, {"before": false, "after": true}], - - // Two space indent - "indent": [2, 2, { "SwitchCase": 1 }], - - // Space after colon not before in property declarations - "key-spacing": [2, { "beforeColon": false, "afterColon": true, "mode": "minimum" }], - - // Unix linebreaks - "linebreak-style": [2, "unix"], - - // Always require parenthesis for new calls - "new-parens": 2, - - // Use [] instead of Array() - // "no-array-constructor": 2, - - // No duplicate arguments in function declarations - "no-dupe-args": 2, - - // No duplicate keys in object declarations - "no-dupe-keys": 2, - - // No duplicate cases in switch statements - "no-duplicate-case": 2, - - // No labels - "no-labels": 2, - - // If an if block ends with a return no need for an else block - "no-else-return": 2, - - // No empty statements - "no-empty": 2, - - // No empty character classes in regex - "no-empty-character-class": 2, - - // Disallow empty destructuring - "no-empty-pattern": 2, - - // No assiging to exception variable - // "no-ex-assign": 2, - - // No using !! where casting to boolean is already happening - // "no-extra-boolean-cast": 2, - - // No double semicolon - "no-extra-semi": 2, - - // No overwriting defined functions - "no-func-assign": 2, - - // Declarations in Program or Function Body - "no-inner-declarations": 2, - - // No invalid regular expresions - "no-invalid-regexp": 2, - - // No odd whitespace characters - "no-irregular-whitespace": 2, - - // No single if block inside an else block - "no-lonely-if": 2, - - // No mixing spaces and tabs in indent - "no-mixed-spaces-and-tabs": [2, "smart-tabs"], - - // No unnecessary spacing - "no-multi-spaces": [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }], - - // No reassigning native JS objects - "no-native-reassign": 2, - - // No (!foo in bar) - "no-negated-in-lhs": 2, - - // Nested ternary statements are confusing - "no-nested-ternary": 2, - - // Use {} instead of new Object() - // "no-new-object": 2, - - // No Math() or JSON() - "no-obj-calls": 2, - - // No octal literals - "no-octal": 2, - - // No redeclaring variables - "no-redeclare": 2, - - // No unnecessary comparisons - "no-self-compare": 2, - - // No declaring variables from an outer scope - "no-shadow": 2, - - // No declaring variables that hide things like arguments - "no-shadow-restricted-names": 2, - - // No spaces between function name and parentheses - "no-spaced-func": 2, - - // No trailing whitespace - "no-trailing-spaces": 2, - - // No using undeclared variables - // "no-undef": 2, - - // Error on newline where a semicolon is needed - "no-unexpected-multiline": 2, - - // No unreachable statements - "no-unreachable": 2, - - // No expressions where a statement is expected - // "no-unused-expressions": 2, - - // No declaring variables that are never used - "no-unused-vars": [2, {"vars": "all", "args": "none"}], - - // No using variables before defined - // "no-use-before-define": [2, "nofunc"], - - // No using with - "no-with": 2, - - // No if/while/for blocks on the same line as the if/while/for statement: - "nonblock-statement-body-position": [2, "below"], - - // Always require semicolon at end of statement - "semi": [2, "always"], - - // Require space after keywords - "keyword-spacing": 2, - - // Always use double quotes - "quotes": [2, "double", {"avoidEscape": true}], - - // Require space before blocks - "space-before-blocks": 2, - - // Never use spaces before function parentheses - // "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }], - - // Require spaces before finally, catch, etc. - // "space-before-keywords": [2, "always"], - - // No space padding in parentheses - // "space-in-parens": [2, "never"], - - // Require spaces around operators - // "space-infix-ops": 2, - - // Require spaces after return, throw and case - // "space-return-throw-case": 2, - - // ++ and -- should not need spacing - // "space-unary-ops": [2, { "words": true, "nonwords": false }], - - // No comparisons to NaN - "use-isnan": 2, - - // Only check typeof against valid results - "valid-typeof": 2, - }, -}; diff --git a/readability-server/node_modules/@mozilla/readability/CODE_OF_CONDUCT.md b/readability-server/node_modules/@mozilla/readability/CODE_OF_CONDUCT.md deleted file mode 100644 index 498baa3..0000000 --- a/readability-server/node_modules/@mozilla/readability/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,15 +0,0 @@ -# Community Participation Guidelines - -This repository is governed by Mozilla's code of conduct and etiquette guidelines. -For more details, please read the -[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/). - -## How to Report -For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page. - - diff --git a/readability-server/node_modules/@mozilla/readability/JSDOMParser.js b/readability-server/node_modules/@mozilla/readability/JSDOMParser.js deleted file mode 100644 index 7bfa2ac..0000000 --- a/readability-server/node_modules/@mozilla/readability/JSDOMParser.js +++ /dev/null @@ -1,1196 +0,0 @@ -/*eslint-env es6:false*/ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * This is a relatively lightweight DOMParser that is safe to use in a web - * worker. This is far from a complete DOM implementation; however, it should - * contain the minimal set of functionality necessary for Readability.js. - * - * Aside from not implementing the full DOM API, there are other quirks to be - * aware of when using the JSDOMParser: - * - * 1) Properly formed HTML/XML must be used. This means you should be extra - * careful when using this parser on anything received directly from an - * XMLHttpRequest. Providing a serialized string from an XMLSerializer, - * however, should be safe (since the browser's XMLSerializer should - * generate valid HTML/XML). Therefore, if parsing a document from an XHR, - * the recommended approach is to do the XHR in the main thread, use - * XMLSerializer.serializeToString() on the responseXML, and pass the - * resulting string to the worker. - * - * 2) Live NodeLists are not supported. DOM methods and properties such as - * getElementsByTagName() and childNodes return standard arrays. If you - * want these lists to be updated when nodes are removed or added to the - * document, you must take care to manually update them yourself. - */ -(function (global) { - - // XML only defines these and the numeric ones: - - var entityTable = { - "lt": "<", - "gt": ">", - "amp": "&", - "quot": '"', - "apos": "'", - }; - - var reverseEntityTable = { - "<": "<", - ">": ">", - "&": "&", - '"': """, - "'": "'", - }; - - function encodeTextContentHTML(s) { - return s.replace(/[&<>]/g, function(x) { - return reverseEntityTable[x]; - }); - } - - function encodeHTML(s) { - return s.replace(/[&<>'"]/g, function(x) { - return reverseEntityTable[x]; - }); - } - - function decodeHTML(str) { - return str.replace(/&(quot|amp|apos|lt|gt);/g, function(match, tag) { - return entityTable[tag]; - }).replace(/&#(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi, function(match, hex, numStr) { - var num = parseInt(hex || numStr, hex ? 16 : 10); // read num - return String.fromCharCode(num); - }); - } - - // When a style is set in JS, map it to the corresponding CSS attribute - var styleMap = { - "alignmentBaseline": "alignment-baseline", - "background": "background", - "backgroundAttachment": "background-attachment", - "backgroundClip": "background-clip", - "backgroundColor": "background-color", - "backgroundImage": "background-image", - "backgroundOrigin": "background-origin", - "backgroundPosition": "background-position", - "backgroundPositionX": "background-position-x", - "backgroundPositionY": "background-position-y", - "backgroundRepeat": "background-repeat", - "backgroundRepeatX": "background-repeat-x", - "backgroundRepeatY": "background-repeat-y", - "backgroundSize": "background-size", - "baselineShift": "baseline-shift", - "border": "border", - "borderBottom": "border-bottom", - "borderBottomColor": "border-bottom-color", - "borderBottomLeftRadius": "border-bottom-left-radius", - "borderBottomRightRadius": "border-bottom-right-radius", - "borderBottomStyle": "border-bottom-style", - "borderBottomWidth": "border-bottom-width", - "borderCollapse": "border-collapse", - "borderColor": "border-color", - "borderImage": "border-image", - "borderImageOutset": "border-image-outset", - "borderImageRepeat": "border-image-repeat", - "borderImageSlice": "border-image-slice", - "borderImageSource": "border-image-source", - "borderImageWidth": "border-image-width", - "borderLeft": "border-left", - "borderLeftColor": "border-left-color", - "borderLeftStyle": "border-left-style", - "borderLeftWidth": "border-left-width", - "borderRadius": "border-radius", - "borderRight": "border-right", - "borderRightColor": "border-right-color", - "borderRightStyle": "border-right-style", - "borderRightWidth": "border-right-width", - "borderSpacing": "border-spacing", - "borderStyle": "border-style", - "borderTop": "border-top", - "borderTopColor": "border-top-color", - "borderTopLeftRadius": "border-top-left-radius", - "borderTopRightRadius": "border-top-right-radius", - "borderTopStyle": "border-top-style", - "borderTopWidth": "border-top-width", - "borderWidth": "border-width", - "bottom": "bottom", - "boxShadow": "box-shadow", - "boxSizing": "box-sizing", - "captionSide": "caption-side", - "clear": "clear", - "clip": "clip", - "clipPath": "clip-path", - "clipRule": "clip-rule", - "color": "color", - "colorInterpolation": "color-interpolation", - "colorInterpolationFilters": "color-interpolation-filters", - "colorProfile": "color-profile", - "colorRendering": "color-rendering", - "content": "content", - "counterIncrement": "counter-increment", - "counterReset": "counter-reset", - "cursor": "cursor", - "direction": "direction", - "display": "display", - "dominantBaseline": "dominant-baseline", - "emptyCells": "empty-cells", - "enableBackground": "enable-background", - "fill": "fill", - "fillOpacity": "fill-opacity", - "fillRule": "fill-rule", - "filter": "filter", - "cssFloat": "float", - "floodColor": "flood-color", - "floodOpacity": "flood-opacity", - "font": "font", - "fontFamily": "font-family", - "fontSize": "font-size", - "fontStretch": "font-stretch", - "fontStyle": "font-style", - "fontVariant": "font-variant", - "fontWeight": "font-weight", - "glyphOrientationHorizontal": "glyph-orientation-horizontal", - "glyphOrientationVertical": "glyph-orientation-vertical", - "height": "height", - "imageRendering": "image-rendering", - "kerning": "kerning", - "left": "left", - "letterSpacing": "letter-spacing", - "lightingColor": "lighting-color", - "lineHeight": "line-height", - "listStyle": "list-style", - "listStyleImage": "list-style-image", - "listStylePosition": "list-style-position", - "listStyleType": "list-style-type", - "margin": "margin", - "marginBottom": "margin-bottom", - "marginLeft": "margin-left", - "marginRight": "margin-right", - "marginTop": "margin-top", - "marker": "marker", - "markerEnd": "marker-end", - "markerMid": "marker-mid", - "markerStart": "marker-start", - "mask": "mask", - "maxHeight": "max-height", - "maxWidth": "max-width", - "minHeight": "min-height", - "minWidth": "min-width", - "opacity": "opacity", - "orphans": "orphans", - "outline": "outline", - "outlineColor": "outline-color", - "outlineOffset": "outline-offset", - "outlineStyle": "outline-style", - "outlineWidth": "outline-width", - "overflow": "overflow", - "overflowX": "overflow-x", - "overflowY": "overflow-y", - "padding": "padding", - "paddingBottom": "padding-bottom", - "paddingLeft": "padding-left", - "paddingRight": "padding-right", - "paddingTop": "padding-top", - "page": "page", - "pageBreakAfter": "page-break-after", - "pageBreakBefore": "page-break-before", - "pageBreakInside": "page-break-inside", - "pointerEvents": "pointer-events", - "position": "position", - "quotes": "quotes", - "resize": "resize", - "right": "right", - "shapeRendering": "shape-rendering", - "size": "size", - "speak": "speak", - "src": "src", - "stopColor": "stop-color", - "stopOpacity": "stop-opacity", - "stroke": "stroke", - "strokeDasharray": "stroke-dasharray", - "strokeDashoffset": "stroke-dashoffset", - "strokeLinecap": "stroke-linecap", - "strokeLinejoin": "stroke-linejoin", - "strokeMiterlimit": "stroke-miterlimit", - "strokeOpacity": "stroke-opacity", - "strokeWidth": "stroke-width", - "tableLayout": "table-layout", - "textAlign": "text-align", - "textAnchor": "text-anchor", - "textDecoration": "text-decoration", - "textIndent": "text-indent", - "textLineThrough": "text-line-through", - "textLineThroughColor": "text-line-through-color", - "textLineThroughMode": "text-line-through-mode", - "textLineThroughStyle": "text-line-through-style", - "textLineThroughWidth": "text-line-through-width", - "textOverflow": "text-overflow", - "textOverline": "text-overline", - "textOverlineColor": "text-overline-color", - "textOverlineMode": "text-overline-mode", - "textOverlineStyle": "text-overline-style", - "textOverlineWidth": "text-overline-width", - "textRendering": "text-rendering", - "textShadow": "text-shadow", - "textTransform": "text-transform", - "textUnderline": "text-underline", - "textUnderlineColor": "text-underline-color", - "textUnderlineMode": "text-underline-mode", - "textUnderlineStyle": "text-underline-style", - "textUnderlineWidth": "text-underline-width", - "top": "top", - "unicodeBidi": "unicode-bidi", - "unicodeRange": "unicode-range", - "vectorEffect": "vector-effect", - "verticalAlign": "vertical-align", - "visibility": "visibility", - "whiteSpace": "white-space", - "widows": "widows", - "width": "width", - "wordBreak": "word-break", - "wordSpacing": "word-spacing", - "wordWrap": "word-wrap", - "writingMode": "writing-mode", - "zIndex": "z-index", - "zoom": "zoom", - }; - - // Elements that can be self-closing - var voidElems = { - "area": true, - "base": true, - "br": true, - "col": true, - "command": true, - "embed": true, - "hr": true, - "img": true, - "input": true, - "link": true, - "meta": true, - "param": true, - "source": true, - "wbr": true - }; - - var whitespace = [" ", "\t", "\n", "\r"]; - - // See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType - var nodeTypes = { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }; - - function getElementsByTagName(tag) { - tag = tag.toUpperCase(); - var elems = []; - var allTags = (tag === "*"); - function getElems(node) { - var length = node.children.length; - for (var i = 0; i < length; i++) { - var child = node.children[i]; - if (allTags || (child.tagName === tag)) - elems.push(child); - getElems(child); - } - } - getElems(this); - elems._isLiveNodeList = true; - return elems; - } - - var Node = function () {}; - - Node.prototype = { - attributes: null, - childNodes: null, - localName: null, - nodeName: null, - parentNode: null, - textContent: null, - nextSibling: null, - previousSibling: null, - - get firstChild() { - return this.childNodes[0] || null; - }, - - get firstElementChild() { - return this.children[0] || null; - }, - - get lastChild() { - return this.childNodes[this.childNodes.length - 1] || null; - }, - - get lastElementChild() { - return this.children[this.children.length - 1] || null; - }, - - appendChild: function (child) { - if (child.parentNode) { - child.parentNode.removeChild(child); - } - - var last = this.lastChild; - if (last) - last.nextSibling = child; - child.previousSibling = last; - - if (child.nodeType === Node.ELEMENT_NODE) { - child.previousElementSibling = this.children[this.children.length - 1] || null; - this.children.push(child); - child.previousElementSibling && (child.previousElementSibling.nextElementSibling = child); - } - this.childNodes.push(child); - child.parentNode = this; - }, - - removeChild: function (child) { - var childNodes = this.childNodes; - var childIndex = childNodes.indexOf(child); - if (childIndex === -1) { - throw "removeChild: node not found"; - } else { - child.parentNode = null; - var prev = child.previousSibling; - var next = child.nextSibling; - if (prev) - prev.nextSibling = next; - if (next) - next.previousSibling = prev; - - if (child.nodeType === Node.ELEMENT_NODE) { - prev = child.previousElementSibling; - next = child.nextElementSibling; - if (prev) - prev.nextElementSibling = next; - if (next) - next.previousElementSibling = prev; - this.children.splice(this.children.indexOf(child), 1); - } - - child.previousSibling = child.nextSibling = null; - child.previousElementSibling = child.nextElementSibling = null; - - return childNodes.splice(childIndex, 1)[0]; - } - }, - - replaceChild: function (newNode, oldNode) { - var childNodes = this.childNodes; - var childIndex = childNodes.indexOf(oldNode); - if (childIndex === -1) { - throw "replaceChild: node not found"; - } else { - // This will take care of updating the new node if it was somewhere else before: - if (newNode.parentNode) - newNode.parentNode.removeChild(newNode); - - childNodes[childIndex] = newNode; - - // update the new node's sibling properties, and its new siblings' sibling properties - newNode.nextSibling = oldNode.nextSibling; - newNode.previousSibling = oldNode.previousSibling; - if (newNode.nextSibling) - newNode.nextSibling.previousSibling = newNode; - if (newNode.previousSibling) - newNode.previousSibling.nextSibling = newNode; - - newNode.parentNode = this; - - // Now deal with elements before we clear out those values for the old node, - // because it can help us take shortcuts here: - if (newNode.nodeType === Node.ELEMENT_NODE) { - if (oldNode.nodeType === Node.ELEMENT_NODE) { - // Both were elements, which makes this easier, we just swap things out: - newNode.previousElementSibling = oldNode.previousElementSibling; - newNode.nextElementSibling = oldNode.nextElementSibling; - if (newNode.previousElementSibling) - newNode.previousElementSibling.nextElementSibling = newNode; - if (newNode.nextElementSibling) - newNode.nextElementSibling.previousElementSibling = newNode; - this.children[this.children.indexOf(oldNode)] = newNode; - } else { - // Hard way: - newNode.previousElementSibling = (function() { - for (var i = childIndex - 1; i >= 0; i--) { - if (childNodes[i].nodeType === Node.ELEMENT_NODE) - return childNodes[i]; - } - return null; - })(); - if (newNode.previousElementSibling) { - newNode.nextElementSibling = newNode.previousElementSibling.nextElementSibling; - } else { - newNode.nextElementSibling = (function() { - for (var i = childIndex + 1; i < childNodes.length; i++) { - if (childNodes[i].nodeType === Node.ELEMENT_NODE) - return childNodes[i]; - } - return null; - })(); - } - if (newNode.previousElementSibling) - newNode.previousElementSibling.nextElementSibling = newNode; - if (newNode.nextElementSibling) - newNode.nextElementSibling.previousElementSibling = newNode; - - if (newNode.nextElementSibling) - this.children.splice(this.children.indexOf(newNode.nextElementSibling), 0, newNode); - else - this.children.push(newNode); - } - } else if (oldNode.nodeType === Node.ELEMENT_NODE) { - // new node is not an element node. - // if the old one was, update its element siblings: - if (oldNode.previousElementSibling) - oldNode.previousElementSibling.nextElementSibling = oldNode.nextElementSibling; - if (oldNode.nextElementSibling) - oldNode.nextElementSibling.previousElementSibling = oldNode.previousElementSibling; - this.children.splice(this.children.indexOf(oldNode), 1); - - // If the old node wasn't an element, neither the new nor the old node was an element, - // and the children array and its members shouldn't need any updating. - } - - - oldNode.parentNode = null; - oldNode.previousSibling = null; - oldNode.nextSibling = null; - if (oldNode.nodeType === Node.ELEMENT_NODE) { - oldNode.previousElementSibling = null; - oldNode.nextElementSibling = null; - } - return oldNode; - } - }, - - __JSDOMParser__: true, - }; - - for (var nodeType in nodeTypes) { - Node[nodeType] = Node.prototype[nodeType] = nodeTypes[nodeType]; - } - - var Attribute = function (name, value) { - this.name = name; - this._value = value; - }; - - Attribute.prototype = { - get value() { - return this._value; - }, - setValue: function(newValue) { - this._value = newValue; - }, - getEncodedValue: function() { - return encodeHTML(this._value); - }, - }; - - var Comment = function () { - this.childNodes = []; - }; - - Comment.prototype = { - __proto__: Node.prototype, - - nodeName: "#comment", - nodeType: Node.COMMENT_NODE - }; - - var Text = function () { - this.childNodes = []; - }; - - Text.prototype = { - __proto__: Node.prototype, - - nodeName: "#text", - nodeType: Node.TEXT_NODE, - get textContent() { - if (typeof this._textContent === "undefined") { - this._textContent = decodeHTML(this._innerHTML || ""); - } - return this._textContent; - }, - get innerHTML() { - if (typeof this._innerHTML === "undefined") { - this._innerHTML = encodeTextContentHTML(this._textContent || ""); - } - return this._innerHTML; - }, - - set innerHTML(newHTML) { - this._innerHTML = newHTML; - delete this._textContent; - }, - set textContent(newText) { - this._textContent = newText; - delete this._innerHTML; - }, - }; - - var Document = function (url) { - this.documentURI = url; - this.styleSheets = []; - this.childNodes = []; - this.children = []; - }; - - Document.prototype = { - __proto__: Node.prototype, - - nodeName: "#document", - nodeType: Node.DOCUMENT_NODE, - title: "", - - getElementsByTagName: getElementsByTagName, - - getElementById: function (id) { - function getElem(node) { - var length = node.children.length; - if (node.id === id) - return node; - for (var i = 0; i < length; i++) { - var el = getElem(node.children[i]); - if (el) - return el; - } - return null; - } - return getElem(this); - }, - - createElement: function (tag) { - var node = new Element(tag); - return node; - }, - - createTextNode: function (text) { - var node = new Text(); - node.textContent = text; - return node; - }, - - get baseURI() { - if (!this.hasOwnProperty("_baseURI")) { - this._baseURI = this.documentURI; - var baseElements = this.getElementsByTagName("base"); - var href = baseElements[0] && baseElements[0].getAttribute("href"); - if (href) { - try { - this._baseURI = (new URL(href, this._baseURI)).href; - } catch (ex) {/* Just fall back to documentURI */} - } - } - return this._baseURI; - }, - }; - - var Element = function (tag) { - // We use this to find the closing tag. - this._matchingTag = tag; - // We're explicitly a non-namespace aware parser, we just pretend it's all HTML. - var lastColonIndex = tag.lastIndexOf(":"); - if (lastColonIndex != -1) { - tag = tag.substring(lastColonIndex + 1); - } - this.attributes = []; - this.childNodes = []; - this.children = []; - this.nextElementSibling = this.previousElementSibling = null; - this.localName = tag.toLowerCase(); - this.tagName = tag.toUpperCase(); - this.style = new Style(this); - }; - - Element.prototype = { - __proto__: Node.prototype, - - nodeType: Node.ELEMENT_NODE, - - getElementsByTagName: getElementsByTagName, - - get className() { - return this.getAttribute("class") || ""; - }, - - set className(str) { - this.setAttribute("class", str); - }, - - get id() { - return this.getAttribute("id") || ""; - }, - - set id(str) { - this.setAttribute("id", str); - }, - - get href() { - return this.getAttribute("href") || ""; - }, - - set href(str) { - this.setAttribute("href", str); - }, - - get src() { - return this.getAttribute("src") || ""; - }, - - set src(str) { - this.setAttribute("src", str); - }, - - get srcset() { - return this.getAttribute("srcset") || ""; - }, - - set srcset(str) { - this.setAttribute("srcset", str); - }, - - get nodeName() { - return this.tagName; - }, - - get innerHTML() { - function getHTML(node) { - var i = 0; - for (i = 0; i < node.childNodes.length; i++) { - var child = node.childNodes[i]; - if (child.localName) { - arr.push("<" + child.localName); - - // serialize attribute list - for (var j = 0; j < child.attributes.length; j++) { - var attr = child.attributes[j]; - // the attribute value will be HTML escaped. - var val = attr.getEncodedValue(); - var quote = (val.indexOf('"') === -1 ? '"' : "'"); - arr.push(" " + attr.name + "=" + quote + val + quote); - } - - if (child.localName in voidElems && !child.childNodes.length) { - // if this is a self-closing element, end it here - arr.push("/>"); - } else { - // otherwise, add its children - arr.push(">"); - getHTML(child); - arr.push(""); - } - } else { - // This is a text node, so asking for innerHTML won't recurse. - arr.push(child.innerHTML); - } - } - } - - // Using Array.join() avoids the overhead from lazy string concatenation. - var arr = []; - getHTML(this); - return arr.join(""); - }, - - set innerHTML(html) { - var parser = new JSDOMParser(); - var node = parser.parse(html); - var i; - for (i = this.childNodes.length; --i >= 0;) { - this.childNodes[i].parentNode = null; - } - this.childNodes = node.childNodes; - this.children = node.children; - for (i = this.childNodes.length; --i >= 0;) { - this.childNodes[i].parentNode = this; - } - }, - - set textContent(text) { - // clear parentNodes for existing children - for (var i = this.childNodes.length; --i >= 0;) { - this.childNodes[i].parentNode = null; - } - - var node = new Text(); - this.childNodes = [ node ]; - this.children = []; - node.textContent = text; - node.parentNode = this; - }, - - get textContent() { - function getText(node) { - var nodes = node.childNodes; - for (var i = 0; i < nodes.length; i++) { - var child = nodes[i]; - if (child.nodeType === 3) { - text.push(child.textContent); - } else { - getText(child); - } - } - } - - // Using Array.join() avoids the overhead from lazy string concatenation. - // See http://blog.cdleary.com/2012/01/string-representation-in-spidermonkey/#ropes - var text = []; - getText(this); - return text.join(""); - }, - - getAttribute: function (name) { - for (var i = this.attributes.length; --i >= 0;) { - var attr = this.attributes[i]; - if (attr.name === name) { - return attr.value; - } - } - return undefined; - }, - - setAttribute: function (name, value) { - for (var i = this.attributes.length; --i >= 0;) { - var attr = this.attributes[i]; - if (attr.name === name) { - attr.setValue(value); - return; - } - } - this.attributes.push(new Attribute(name, value)); - }, - - removeAttribute: function (name) { - for (var i = this.attributes.length; --i >= 0;) { - var attr = this.attributes[i]; - if (attr.name === name) { - this.attributes.splice(i, 1); - break; - } - } - }, - - hasAttribute: function (name) { - return this.attributes.some(function (attr) { - return attr.name == name; - }); - }, - }; - - var Style = function (node) { - this.node = node; - }; - - // getStyle() and setStyle() use the style attribute string directly. This - // won't be very efficient if there are a lot of style manipulations, but - // it's the easiest way to make sure the style attribute string and the JS - // style property stay in sync. Readability.js doesn't do many style - // manipulations, so this should be okay. - Style.prototype = { - getStyle: function (styleName) { - var attr = this.node.getAttribute("style"); - if (!attr) - return undefined; - - var styles = attr.split(";"); - for (var i = 0; i < styles.length; i++) { - var style = styles[i].split(":"); - var name = style[0].trim(); - if (name === styleName) - return style[1].trim(); - } - - return undefined; - }, - - setStyle: function (styleName, styleValue) { - var value = this.node.getAttribute("style") || ""; - var index = 0; - do { - var next = value.indexOf(";", index) + 1; - var length = next - index - 1; - var style = (length > 0 ? value.substr(index, length) : value.substr(index)); - if (style.substr(0, style.indexOf(":")).trim() === styleName) { - value = value.substr(0, index).trim() + (next ? " " + value.substr(next).trim() : ""); - break; - } - index = next; - } while (index); - - value += " " + styleName + ": " + styleValue + ";"; - this.node.setAttribute("style", value.trim()); - } - }; - - // For each item in styleMap, define a getter and setter on the style - // property. - for (var jsName in styleMap) { - (function (cssName) { - Style.prototype.__defineGetter__(jsName, function () { - return this.getStyle(cssName); - }); - Style.prototype.__defineSetter__(jsName, function (value) { - this.setStyle(cssName, value); - }); - })(styleMap[jsName]); - } - - var JSDOMParser = function () { - this.currentChar = 0; - - // In makeElementNode() we build up many strings one char at a time. Using - // += for this results in lots of short-lived intermediate strings. It's - // better to build an array of single-char strings and then join() them - // together at the end. And reusing a single array (i.e. |this.strBuf|) - // over and over for this purpose uses less memory than using a new array - // for each string. - this.strBuf = []; - - // Similarly, we reuse this array to return the two arguments from - // makeElementNode(), which saves us from having to allocate a new array - // every time. - this.retPair = []; - - this.errorState = ""; - }; - - JSDOMParser.prototype = { - error: function(m) { - if (typeof dump !== "undefined") { - dump("JSDOMParser error: " + m + "\n"); - } else if (typeof console !== "undefined") { - console.log("JSDOMParser error: " + m + "\n"); - } - this.errorState += m + "\n"; - }, - - /** - * Look at the next character without advancing the index. - */ - peekNext: function () { - return this.html[this.currentChar]; - }, - - /** - * Get the next character and advance the index. - */ - nextChar: function () { - return this.html[this.currentChar++]; - }, - - /** - * Called after a quote character is read. This finds the next quote - * character and returns the text string in between. - */ - readString: function (quote) { - var str; - var n = this.html.indexOf(quote, this.currentChar); - if (n === -1) { - this.currentChar = this.html.length; - str = null; - } else { - str = this.html.substring(this.currentChar, n); - this.currentChar = n + 1; - } - - return str; - }, - - /** - * Called when parsing a node. This finds the next name/value attribute - * pair and adds the result to the attributes list. - */ - readAttribute: function (node) { - var name = ""; - - var n = this.html.indexOf("=", this.currentChar); - if (n === -1) { - this.currentChar = this.html.length; - } else { - // Read until a '=' character is hit; this will be the attribute key - name = this.html.substring(this.currentChar, n); - this.currentChar = n + 1; - } - - if (!name) - return; - - // After a '=', we should see a '"' for the attribute value - var c = this.nextChar(); - if (c !== '"' && c !== "'") { - this.error("Error reading attribute " + name + ", expecting '\"'"); - return; - } - - // Read the attribute value (and consume the matching quote) - var value = this.readString(c); - - node.attributes.push(new Attribute(name, decodeHTML(value))); - - return; - }, - - /** - * Parses and returns an Element node. This is called after a '<' has been - * read. - * - * @returns an array; the first index of the array is the parsed node; - * the second index is a boolean indicating whether this is a void - * Element - */ - makeElementNode: function (retPair) { - var c = this.nextChar(); - - // Read the Element tag name - var strBuf = this.strBuf; - strBuf.length = 0; - while (whitespace.indexOf(c) == -1 && c !== ">" && c !== "/") { - if (c === undefined) - return false; - strBuf.push(c); - c = this.nextChar(); - } - var tag = strBuf.join(""); - - if (!tag) - return false; - - var node = new Element(tag); - - // Read Element attributes - while (c !== "/" && c !== ">") { - if (c === undefined) - return false; - while (whitespace.indexOf(this.html[this.currentChar++]) != -1) { - // Advance cursor to first non-whitespace char. - } - this.currentChar--; - c = this.nextChar(); - if (c !== "/" && c !== ">") { - --this.currentChar; - this.readAttribute(node); - } - } - - // If this is a self-closing tag, read '/>' - var closed = false; - if (c === "/") { - closed = true; - c = this.nextChar(); - if (c !== ">") { - this.error("expected '>' to close " + tag); - return false; - } - } - - retPair[0] = node; - retPair[1] = closed; - return true; - }, - - /** - * If the current input matches this string, advance the input index; - * otherwise, do nothing. - * - * @returns whether input matched string - */ - match: function (str) { - var strlen = str.length; - if (this.html.substr(this.currentChar, strlen).toLowerCase() === str.toLowerCase()) { - this.currentChar += strlen; - return true; - } - return false; - }, - - /** - * Searches the input until a string is found and discards all input up to - * and including the matched string. - */ - discardTo: function (str) { - var index = this.html.indexOf(str, this.currentChar) + str.length; - if (index === -1) - this.currentChar = this.html.length; - this.currentChar = index; - }, - - /** - * Reads child nodes for the given node. - */ - readChildren: function (node) { - var child; - while ((child = this.readNode())) { - // Don't keep Comment nodes - if (child.nodeType !== 8) { - node.appendChild(child); - } - } - }, - - discardNextComment: function() { - if (this.match("--")) { - this.discardTo("-->"); - } else { - var c = this.nextChar(); - while (c !== ">") { - if (c === undefined) - return null; - if (c === '"' || c === "'") - this.readString(c); - c = this.nextChar(); - } - } - return new Comment(); - }, - - - /** - * Reads the next child node from the input. If we're reading a closing - * tag, or if we've reached the end of input, return null. - * - * @returns the node - */ - readNode: function () { - var c = this.nextChar(); - - if (c === undefined) - return null; - - // Read any text as Text node - var textNode; - if (c !== "<") { - --this.currentChar; - textNode = new Text(); - var n = this.html.indexOf("<", this.currentChar); - if (n === -1) { - textNode.innerHTML = this.html.substring(this.currentChar, this.html.length); - this.currentChar = this.html.length; - } else { - textNode.innerHTML = this.html.substring(this.currentChar, n); - this.currentChar = n; - } - return textNode; - } - - if (this.match("![CDATA[")) { - var endChar = this.html.indexOf("]]>", this.currentChar); - if (endChar === -1) { - this.error("unclosed CDATA section"); - return null; - } - textNode = new Text(); - textNode.textContent = this.html.substring(this.currentChar, endChar); - this.currentChar = endChar + ("]]>").length; - return textNode; - } - - c = this.peekNext(); - - // Read Comment node. Normally, Comment nodes know their inner - // textContent, but we don't really care about Comment nodes (we throw - // them away in readChildren()). So just returning an empty Comment node - // here is sufficient. - if (c === "!" || c === "?") { - // We're still before the ! or ? that is starting this comment: - this.currentChar++; - return this.discardNextComment(); - } - - // If we're reading a closing tag, return null. This means we've reached - // the end of this set of child nodes. - if (c === "/") { - --this.currentChar; - return null; - } - - // Otherwise, we're looking at an Element node - var result = this.makeElementNode(this.retPair); - if (!result) - return null; - - var node = this.retPair[0]; - var closed = this.retPair[1]; - var localName = node.localName; - - // If this isn't a void Element, read its child nodes - if (!closed) { - this.readChildren(node); - var closingTag = ""; - if (!this.match(closingTag)) { - this.error("expected '" + closingTag + "' and got " + this.html.substr(this.currentChar, closingTag.length)); - return null; - } - } - - // Only use the first title, because SVG might have other - // title elements which we don't care about (medium.com - // does this, at least). - if (localName === "title" && !this.doc.title) { - this.doc.title = node.textContent.trim(); - } else if (localName === "head") { - this.doc.head = node; - } else if (localName === "body") { - this.doc.body = node; - } else if (localName === "html") { - this.doc.documentElement = node; - } - - return node; - }, - - /** - * Parses an HTML string and returns a JS implementation of the Document. - */ - parse: function (html, url) { - this.html = html; - var doc = this.doc = new Document(url); - this.readChildren(doc); - - // If this is an HTML document, remove root-level children except for the - // node - if (doc.documentElement) { - for (var i = doc.childNodes.length; --i >= 0;) { - var child = doc.childNodes[i]; - if (child !== doc.documentElement) { - doc.removeChild(child); - } - } - } - - return doc; - } - }; - - // Attach the standard DOM types to the global scope - global.Node = Node; - global.Comment = Comment; - global.Document = Document; - global.Element = Element; - global.Text = Text; - - // Attach JSDOMParser to the global scope - global.JSDOMParser = JSDOMParser; - -})(this); - -if (typeof module === "object") { - module.exports = this.JSDOMParser; -} diff --git a/readability-server/node_modules/@mozilla/readability/README.md b/readability-server/node_modules/@mozilla/readability/README.md deleted file mode 100644 index c908d2d..0000000 --- a/readability-server/node_modules/@mozilla/readability/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# Readability.js - -A standalone version of the readability library used for Firefox Reader View. - -## Usage on the web - -To parse a document, you must create a new `Readability` object from a DOM document object, and then call `parse()`. Here's an example: - -```javascript -var article = new Readability(document).parse(); -``` - -This `article` object will contain the following properties: - -* `title`: article title -* `content`: HTML string of processed article content -* `length`: length of an article, in characters -* `excerpt`: article description, or short excerpt from the content -* `byline`: author metadata -* `dir`: content direction - -If you're using Readability on the web, you will likely be able to use a `document` reference -from elsewhere (e.g. fetched via XMLHttpRequest, in a same-origin `