Merge pull request #332 from gijsk/fix-readability-determination-in-generate-testcase

Use jsdom for parsing the document to determine readability (fixes #325), r=evanxd
pull/323/head
Evan Tseng 8 years ago committed by GitHub
commit a34d054f45

@ -111,12 +111,25 @@ function runReadability(source, destPath, metadataDestPath) {
var myReader, result, readerable;
try {
myReader = new Readability(uri, doc);
readerable = myReader.isProbablyReaderable();
result = myReader.parse();
} catch (ex) {
console.error(ex);
ex.stack.forEach(console.log.bind(console));
}
// Use jsdom for isProbablyReaderable because it supports querySelectorAll
try {
var jsdomDoc = jsdom(source, {
features: {
FetchExternalResources: false,
ProcessExternalResources: false
}
});
myReader = new Readability(uri, jsdomDoc);
readerable = myReader.isProbablyReaderable();
} catch (ex) {
console.error(ex);
ex.stack.forEach(console.log.bind(console));
}
if (!result) {
console.error("No content generated by readability, not going to write expected.html!");
return;

@ -1,6 +1,7 @@
{
"title": "Open Verilog flow for Silego GreenPak4 programmable logic devices",
"byline": null,
"dir": "ltr",
"excerpt": "I've written a couple of posts in the past few months but they were all for",
"readerable": true
}

Loading…
Cancel
Save