diff options
author | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 15:58:53 +0000 |
---|---|---|
committer | umbrae <umbrae@d4e419ec-0920-11de-bbfd-a7c1bc4c261e> | 2009-03-11 15:58:53 +0000 |
commit | 9980a2d430b66db1069d10622520b4806313ceda (patch) | |
tree | dec5d724518cfb7017b5c12bb1cf68ae20f82340 /js | |
parent | 3fc0722518f69935a67e49e8fc423317f0308e01 (diff) | |
download | readability-simple-9980a2d430b66db1069d10622520b4806313ceda.tar.bz2 readability-simple-9980a2d430b66db1069d10622520b4806313ceda.zip |
Tweak to the regular expression to determine special classnames/id's
git-svn-id: http://arc90labs-readability.googlecode.com/svn/trunk@28 d4e419ec-0920-11de-bbfd-a7c1bc4c261e
Diffstat (limited to 'js')
-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 8719d21..ef8b0e4 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(/(hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))/))
+ 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(/(hentry|entry[-]?(content|text)|article[-]?(text|content))/))
+ else if(parentNode.id.match(/((^|\\s)(post|hentry|entry[-]?(content|text|body)|article[-]?(content|text|body))(\\s|$))/))
parentNode.readability.contentScore += 25;
}
|