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

Using both article.content and article.textBody does not work #71

Open
felipe-augusto opened this issue May 5, 2016 · 3 comments
Open

Comments

@felipe-augusto
Copy link

felipe-augusto commented May 5, 2016

If I do this:

var textBody = article.textBody;
var content = article.content;

The content turns out to be wrong, but if I change the order the same thing applies to the textBody. You can call only one.

@sicongzhao
Copy link

Same problem. Have you found any solution yet?

@felipe-augusto
Copy link
Author

In the end, I just imported another module, named html-to-text and used it to get the text. Something like this:

var htmlToText = require('html-to-text');

var html = article.content;

var text = htmlToText.fromString(html, {
    ignoreHref: true,
    ignoreImage: true
});

@sicongzhao
Copy link

Nice solution! Thanks dude:)

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

2 participants