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() includes text within <script> and <style> #986

Closed
Vittoriourzi opened this issue Feb 22, 2017 · 2 comments
Closed

.text() includes text within <script> and <style> #986

Vittoriourzi opened this issue Feb 22, 2017 · 2 comments
Labels

Comments

@Vittoriourzi
Copy link

Vittoriourzi commented Feb 22, 2017

cheerio .text() not strip inline style and scripts.
If i perform a $("html").text() for strips all tags, the script include in text the textual content inside the inline script.

example of an html.

<html><head></head><body>
<div>ciao</div>
<script>function(){blablabla}</script>
</body></html>

if a do: $("html").text() the ouput will be:
ciao function(){blablabla}

But in jQuery the inline tags were strip and removed too!

@fb55 fb55 changed the title cheerio .text() not strip inline style and scripts .text() includes text within <script> and <style> Mar 8, 2017
@fb55 fb55 added the ❌ Bug label Mar 8, 2017
@henrix343
Copy link

@Vittoriourzi does cherio suport innerText ?

@matthewmueller
Copy link
Member

This is currently implemented, but may be reverted. See: #1050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants