diff options
author | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 16:04:36 +0000 |
---|---|---|
committer | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 16:04:36 +0000 |
commit | 422bfc71671ffd1a765e5654199d87cf7d0f9ee9 (patch) | |
tree | 3e1929dd0305d2d74d8ca0c38e37178047f83f64 | |
parent | 9980a2d430b66db1069d10622520b4806313ceda (diff) | |
download | readability-simple-422bfc71671ffd1a765e5654199d87cf7d0f9ee9.tar.bz2 readability-simple-422bfc71671ffd1a765e5654199d87cf7d0f9ee9.zip |
Tweak to the regular expression to determine special classnames/id's
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@29 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
-rwxr-xr-x | js/readability.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/readability.js b/js/readability.js index ef8b0e4..934ffb8 100755 --- a/js/readability.js +++ b/js/readability.js @@ -59,13 +59,13 @@ function grabArticle() { // Look for a special classname
if(parentNode.className.match(/(comment|meta|footer|footnote)/))
parentNode.readability.contentScore -= 50;
- else if(parentNode.className.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))(\\s|$))/))
+ else if(parentNode.className.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)?|article[-]?(content|text|body)?)(\\s|$))/))
parentNode.readability.contentScore += 25;
// Look for a special ID
if(parentNode.id.match(/(comment|meta|footer|footnote)/))
parentNode.readability.contentScore -= 50;
- else if(parentNode.id.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))(\\s|$))/))
+ else if(parentNode.id.match(/^(post|hentry|entry[-]?(content|text|body)?|article[-]?(content|text|body)?)$/))
parentNode.readability.contentScore += 25;
}
|