Skip to content

Commit

Permalink
Add a newline between class and id so you can match with special rege…
Browse files Browse the repository at this point in the history
…x characters (eg. ^)
  • Loading branch information
haroldtreen committed May 21, 2016
1 parent 0b2a764 commit cdf499d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var grabArticle = module.exports.grabArticle = function(document, preserveUnlike
// Remove unlikely candidates */
var continueFlag = false;
if (!preserveUnlikelyCandidates) {
var unlikelyMatchString = node.className + node.id;
var unlikelyMatchString = node.className + '\n' + node.id;
if (unlikelyMatchString.search(regexps.unlikelyCandidatesRe) !== -1 && unlikelyMatchString.search(regexps.okMaybeItsACandidateRe) == -1 && node.tagName !== 'HTML' && node.tagName !== "BODY") {
dbg("Removing unlikely candidate - " + unlikelyMatchString);
node.parentNode.removeChild(node);
Expand Down

0 comments on commit cdf499d

Please sign in to comment.