Avoid global flag when looking for metadata using regexes

This commit is contained in:
Gijs Kruitbosch 2018-08-20 17:40:00 +01:00 committed by Johann Hofmann
parent 93a2f1b026
commit f782bc5f06
5 changed files with 6 additions and 6 deletions

View File

@ -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) {

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}