Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text display broken for economictimes articles #43

Open
RaviBolla opened this issue Apr 24, 2017 · 0 comments
Open

Text display broken for economictimes articles #43

RaviBolla opened this issue Apr 24, 2017 · 0 comments

Comments

@RaviBolla
Copy link

Problem in reading following url
http://economictimes.indiatimes.com/news/politics-and-nation/justice-c-s-karnan-attends-to-chamber-related-work-at-calcutta-hc/articleshow/58110699.cms

html content:

<p class="read-art-extra-bonus">KOLKATA: Justice</p>
						<a onclick="ga('send', 'event', 'ArticleShow', 'C S Karnan Click', 'In Article');" href="http://economictimes.indiatimes.com/topic/C-S-Karnan" target="_blank">C S Karnan</a>
						<p class="read-art-extra-bonus">today went to his chamber at the</p>
						<a onclick="ga('send', 'event', 'ArticleShow', 'Calcutta High Court Click', 'In Article');" href="http://economictimes.indiatimes.com/topic/Calcutta-High-Court" target="_blank">Calcutta High Court</a>
						<p class="read-art-extra-bonus">for the first time since the</p>
						<a onclick="ga('send', 'event', 'ArticleShow', 'Supreme Court Click', 'In Article');" href="http://economictimes.indiatimes.com/topic/Supreme-Court" target="_blank">Supreme Court</a>
						<p class="read-art-extra-bonus">withdrew the judicial and administrative works from him on February 8.</p>

First paragraph text looks like this

KOLKATA: Justice

C S Karnan
today went to his chamber at the

Calcutta High Court
for the first time since the

Supreme Court
withdrew the judicial and administrative works from him on February 8.

This is broken because plain text within "div" elements are converted to "p" element here

Generally, plain text within div should be "span" element
I think following change will fix the issue:
child.replaceWith('<span class="' + extBonusKey + '">' + childDom.data + '</span>')

RaviBolla added a commit to RaviBolla/node-readability that referenced this issue May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant