List all known properties and ignore wantedProperties

merge-requests/1/head
Olivier Tremblay 4 years ago
parent 855a8aad33
commit f431686a59

@ -335,11 +335,14 @@ function onLoadDOM(dom) {
return; return;
} }
if (outputJSON){ if (outputJSON){
var result = {}; let result = {};
for (propkey in wantedProperties) { const allprops = ["title", "excerpt", "byline", "length", "dir", "textContent"];
let prop = wantedProperties[propkey]; for (propkey in allprops) {
let prop = allprops[propkey];
result[prop] = article[prop]; result[prop] = article[prop];
} }
result["htmlContent"] = article.content;
result["htmlTitle"] = `<h1>${escapeHTML(article.title, document)}</h1>`
writeStream.write(JSON.stringify(result)); writeStream.write(JSON.stringify(result));
return; return;
} }

Loading…
Cancel
Save