Improve content detection
This commit is contained in:
parent
9777c87192
commit
64e85099ad
1 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
flux_words_count: function flux_words_count(flux) {
|
||||
|
||||
reading_time.textContent = flux.childNodes[2].childNodes[1].textContent; // get textContent, from the article itself (not the header, not the bottom line). `childNodes[2].childNodes[1]` gives : `<div class="content no_limit">` element
|
||||
reading_time.textContent = flux.querySelector('.flux_content').textContent; // get textContent, from the article itself (not the header, not the bottom line). `childNodes[2].childNodes[1]` gives : `<div class="content no_limit">` element
|
||||
|
||||
// split the text to count the words correctly (source: http://www.mediacollege.com/internet/javascript/text/count-words.html)
|
||||
reading_time.textContent = reading_time.textContent.replace(/(^\s*)|(\s*$)/gi,"");//exclude start and end white-space
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue