diff --git a/README.md b/README.md index d511b34d..618759d1 100644 --- a/README.md +++ b/README.md @@ -508,6 +508,17 @@ pnpm eval {URL_TO_PARSE_ARTICLE} ``` ## License + The MIT License (MIT) +## Support the project + +If you find value from this open source project, you can support in the following ways: + +- Give it a star ⭐ +- Buy me a coffee: https://paypal.me/ndaidong 🍵 +- Subscribe [Article Extractor service](https://rapidapi.com/pwshub-pwshub-default/api/article-extractor2) on RapidAPI 😉 + +Thank you. + --- diff --git a/package.json b/package.json index 46135320..54f621ea 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.0.1", + "version": "8.0.2", "name": "@extractus/article-extractor", "description": "To extract main article from given URL", "homepage": "https://github.com/extractus/article-extractor", @@ -38,9 +38,9 @@ }, "devDependencies": { "@types/sanitize-html": "^2.9.0", - "eslint": "^8.45.0", + "eslint": "^8.47.0", "https-proxy-agent": "^7.0.1", - "jest": "^29.6.1", + "jest": "^29.6.2", "nock": "^13.3.2" }, "keywords": [ diff --git a/src/utils/linker.js b/src/utils/linker.js index 666b2531..9cbe837b 100644 --- a/src/utils/linker.js +++ b/src/utils/linker.js @@ -124,7 +124,7 @@ export const normalize = (html, url) => { } }) - return Array.from(doc.children).map(element => element.outerHTML).join('') + return Array.from(doc.childNodes).map(element => element.outerHTML).join('') } export const getDomain = (url) => { diff --git a/src/utils/transformation.js b/src/utils/transformation.js index d97a6720..9ec2d9ef 100644 --- a/src/utils/transformation.js +++ b/src/utils/transformation.js @@ -59,11 +59,11 @@ export const findTransformations = (links) => { export const execPreParser = (html, links) => { const doc = new DOMParser().parseFromString(html, 'text/html') findTransformations(links).map(tfm => tfm.pre).filter(fn => isFunction(fn)).map(fn => fn(doc)) - return Array.from(doc.children).map(it => it.outerHTML).join('') + return Array.from(doc.childNodes).map(it => it.outerHTML).join('') } export const execPostParser = (html, links) => { const doc = new DOMParser().parseFromString(html, 'text/html') findTransformations(links).map(tfm => tfm.post).filter(fn => isFunction(fn)).map(fn => fn(doc)) - return Array.from(doc.children).map(it => it.outerHTML).join('') + return Array.from(doc.childNodes).map(it => it.outerHTML).join('') }