Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,8 @@ function getCandidates ($, options) {
}
// cache innerText here.
var childDom = child.get(0)
var innerText
if (childDom.type === 'text' && (innerText = childDom.data.trim())) {
child.replaceWith('<p class="' + extBonusKey + '">' + innerText + '</p>')
innerText = null
if (childDom.type === 'text' && childDom.data.trim()) {
child.replaceWith('<span class="' + extBonusKey + '">' + childDom.data + '</span>')
}
})
}
Expand All @@ -452,7 +450,7 @@ function getCandidates ($, options) {
}
})
// assign scores to `P`s that were turned from DIV by us.
$('p.' + extBonusKey, 'body').each(function () {
$('p.' + extBonusKey + ',span.' + extBonusKey, 'body').each(function () {
getNodeWeight($(this), cans, options)
})
return cans
Expand Down