Closed MatteoGauthier closed 4 months ago
This is not a bug, replaceWith
returns the original detached element, not the new one.
Thank you @prokoma!
@MatteoGauthier Curious what your use-case is for chaining these — replacing and immediately replacing again seems counter-intuitive?
Ok my bad, thanks @prokoma for your explanation, I've found a workaround
Hello
When attempting to replace multiple elements in sequence using Cheerio, the second replacement operation seems to be ignored. The provided test case aims to replace occurrences of
<li>
tags and the text "Plum" string, but the second replacement with<li class="juice">Juice</li>
does not take effect as expected.Reproduction
In the
manipulation.spec.ts
file add this test case to thereplaceWith
describe