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

All examples are broken for v1.0.0 (rc2) - cheerio outputs html-tags #1239

Closed
luxalpa opened this issue Oct 19, 2018 · 2 comments
Closed

All examples are broken for v1.0.0 (rc2) - cheerio outputs html-tags #1239

luxalpa opened this issue Oct 19, 2018 · 2 comments

Comments

@luxalpa
Copy link

luxalpa commented Oct 19, 2018

Running the example

const cheerio = require('cheerio')
const $ = cheerio.load('<h2 class="title">Hello world</h2>')

$('h2.title').text('Hello there!')
$('h2').addClass('welcome')

$.html()
//=> <h2 class="title welcome">Hello there!</h2>

it's supposed to print out <h2 class="title welcome">Hello there!</h2>, however, it prints <html><head></head><body><h2 class="title welcome">Hello there!</h2></body></html>

This breaks my workflow, because I'm using it to preprocess vue.js templates (i.e. html snippets) and putting tags there inside of the <template> tags breaks everything.

repro: https://repl.it/repls/ImmediateWittyAnalysts

@curbengh
Copy link
Contributor

curbengh commented Oct 27, 2018

See #1031 #1029

@fb55
Copy link
Member

fb55 commented Dec 20, 2020

Thanks @curbengh

@fb55 fb55 closed this as completed Dec 20, 2020
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

3 participants