I am trying to replace all links in body to spans like this.
map((body) => {
let dom = parse(body.toString());
dom.querySelectorAll('a').forEach((link) => {
dom.exchangeChild(link, parse(`<span>lalala</span>`));
});
return dom;
})
Any suggestions or guesses why this is not working?