Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
skid committed Feb 29, 2012
1 parent 8f513be commit 86d9088
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extractor.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ function analyze(subtree, parent, root, depth) {
} }


// Qualifies as a title node // Qualifies as a title node
if( (root.titleWords) && (root.titleWords - node.words <= titleThreshold) && (root.titleWords - node.words >= 0) && (root.titleData.indexOf(data.toLowerCase()) !== -1) ){ if( (root.titleWords) &&
(root.titleWords - node.words <= titleThreshold) &&
(root.titleWords - node.data.split(reg_title).length >= 0) &&
(root.titleData.indexOf(data.toLowerCase()) !== -1) ){
// There is a title element in the head containing the exact words as this node (plus maybe a few more). // There is a title element in the head containing the exact words as this node (plus maybe a few more).
root.heading = node.data.toLowerCase(); root.heading = node.data.toLowerCase();
root.headingNode = parent; root.headingNode = parent;
Expand Down

0 comments on commit 86d9088

Please sign in to comment.