diff --git a/examples/pupperteer/README.md b/examples/pupperteer/README.md index dc5505a..86aad2e 100644 --- a/examples/pupperteer/README.md +++ b/examples/pupperteer/README.md @@ -14,6 +14,6 @@ Start server: npm start ``` -Open `http://localhost:3100/?url=https://www.techradar.com/televisions/samsungs-new-cheaper-oled-tvs-are-now-available-to-buy` to see the result. +Open `http://localhost:3100/?url=https://client-side-rendering.pages.dev/lorem-ipsum` to see the result. --- diff --git a/src/utils/parseFromHtml.js b/src/utils/parseFromHtml.js index 71e13c7..2375e74 100644 --- a/src/utils/parseFromHtml.js +++ b/src/utils/parseFromHtml.js @@ -30,8 +30,8 @@ const summarize = (desc, txt, threshold, maxlen) => { // eslint-disable-line } export default async (inputHtml, inputUrl = '', parserOptions = {}) => { - const html = purify(inputHtml) - const meta = extractMetaData(html) + const pureHtml = purify(inputHtml) + const meta = extractMetaData(pureHtml) let title = meta.title @@ -57,7 +57,7 @@ export default async (inputHtml, inputUrl = '', parserOptions = {}) => { // gather title if (!title) { - title = extractTitleWithReadability(html, inputUrl) + title = extractTitleWithReadability(pureHtml, inputUrl) } if (!title) { return null @@ -95,7 +95,7 @@ export default async (inputHtml, inputUrl = '', parserOptions = {}) => { } ) - const content = fns(html) + const content = fns(inputHtml) if (!content) { return null