We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Not sure if it's actually valid to do el.replaceWith((i, el) => el), but:
el.replaceWith((i, el) => el)
const $ = cheerio.load('<a>foo</a>'); $('a').replaceWith((i, el) => el); $('a').replaceWith('<a>bar</a>'); $.html(); //⇒ "<a>foo</a>"
It looks like el.root is no longer set after the first replaceWith.
el.root
replaceWith
The text was updated successfully, but these errors were encountered:
fix(replaceWith): Fix replacing element with itself
e8a29b1
Fixes #962
fix(replaceWith): Fix replacing element with itself (#1581)
88ae636
Successfully merging a pull request may close this issue.
Not sure if it's actually valid to do
el.replaceWith((i, el) => el)
, but:It looks like
el.root
is no longer set after the firstreplaceWith
.The text was updated successfully, but these errors were encountered: