From f431686a596e2941c9c589164de653e453e12d5c Mon Sep 17 00:00:00 2001 From: Olivier Tremblay Date: Wed, 11 Nov 2020 09:52:59 -0500 Subject: [PATCH] List all known properties and ignore wantedProperties --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index afe50c1..389499c 100755 --- a/index.js +++ b/index.js @@ -335,11 +335,14 @@ function onLoadDOM(dom) { return; } if (outputJSON){ - var result = {}; - for (propkey in wantedProperties) { - let prop = wantedProperties[propkey]; + let result = {}; + const allprops = ["title", "excerpt", "byline", "length", "dir", "textContent"]; + for (propkey in allprops) { + let prop = allprops[propkey]; result[prop] = article[prop]; } + result["htmlContent"] = article.content; + result["htmlTitle"] = `

${escapeHTML(article.title, document)}

` writeStream.write(JSON.stringify(result)); return; }