Avoid global flag when looking for metadata using regexes

pull/482/head
Gijs Kruitbosch 6 years ago committed by Johann Hofmann
parent 93a2f1b026
commit f782bc5f06

@ -1200,10 +1200,10 @@ Readability.prototype = {
// Match "description", or Twitter's "twitter:description" (Cards)
// in name attribute.
var namePattern = /^\s*((twitter)\s*:\s*)?(description|title)\s*$/gi;
var namePattern = /^\s*((twitter)\s*:\s*)?(description|title)\s*$/i;
// Match Facebook's Open Graph title & description properties.
var propertyPattern = /^\s*og\s*:\s*(description|title)\s*$/gi;
var propertyPattern = /^\s*og\s*:\s*(description|title)\s*$/i;
// Find description tags.
this._forEachNode(metaElements, function(element) {

@ -2,6 +2,6 @@
"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 the blog at work so I figured I'm long overdue for one on Silicon Exposed.",
"excerpt": "I've written a couple of posts in the past few months but they were all for the blog at work so I figured I'm long overdue for one on Silic...",
"readerable": true
}

@ -1,6 +1,6 @@
{
"title": "Una solución no violenta para la cuestión mapuche - 07.12.2017",
"byline": null,
"excerpt": "Los pueblos indígenas reclaman por derechos que permanecen\n incumplidos, por eso es más eficiente canalizar la protesta que reprimirla",
"excerpt": "Una solución no violenta para la cuestión mapuche | Los pueblos indígenas reclaman por derechos que permanecen incumplidos, por eso es más eficiente canalizar la protesta que reprimirla - LA NACION",
"readerable": true
}

@ -2,6 +2,6 @@
"title": "Saving Data: Reducing the size of App Updates by 65%",
"byline": null,
"dir": "ltr",
"excerpt": "Posted by Andrew Hayden, Software Engineer on Google Play",
"excerpt": "Posted by Andrew Hayden, Software Engineer on Google Play Android users are downloading tens of billions of apps and games on Google Pla...",
"readerable": true
}

@ -2,6 +2,6 @@
"title": "Welcome to Firefox Developer Edition",
"byline": null,
"dir": "ltr",
"excerpt": "Get to know the features that make it the most complete browser for building the Web.",
"excerpt": "Built for those who build the Web. Introducing the only browser made for developers.",
"readerable": false
}

Loading…
Cancel
Save