question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I convert the .html() to normal text?

See original GitHub issue

Cheerio only provides $.html() to get the html string. However, all the unicode is converted like 你可能感兴趣. I want to convert these encoded html to normal text like 你可能感兴趣.

How can I do it in Node.js?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

7reactions
yepninjacommented, Oct 7, 2015
$ = cheerio.load('<ul id="fruits">你可能感兴趣</ul>', {
    decodeEntities: false
});
0reactions
ufo22940268commented, Dec 21, 2015

Cool. But what is decodeEntities used for. If set it to false, it will cause parsing slower?

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 ways to convert HTML text to plain text - DEV Community ‍ ‍
3 ways to convert HTML text to plain text ; 1) Using .replace(/<[^>]*>/g, '') · var myHTML ; 2) Create a temporary DOM...
Read more >
HTML to Text - Text Fixer
Convert HTML code to plain TEXT paragraphs with this free html to text tool. This tool works with whole web pages or snippets...
Read more >
HTML to Text Email Converter | Email Design Reference
It's always a good idea to send a plain-text version of your HTML email. ... Paste your email's HTML below, click Convert, and...
Read more >
3 Different Ways To Convert HTML Into Plain Text
3 Different Ways To Convert HTML Into Plain Text · 1. Using .replace(/<[^>]*>/g, '') · 2. Create a temporary DOM element and retrieve...
Read more >
How do you convert Html to plain text? - Stack Overflow
HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(htmlString); var textString = doc.DocumentNode.InnerText; Regex.Replace(textString , @"<(.|n)*?>", string.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found