https://perchance.org/2p16eseroi#edit

Got a tricky situation here. If I do a .replace() on the html of an element (just some formatting stuff for code blocks), the update() is still referencing old text nodes. So it just doesn’t care about the new ones that are there from the replace and they stay there. And it adds new ones that are actually updated.

Not sure what to do about that, honestly. Ideally I’d be able to do this replace before the initial update of code blocks is run. Is there some way of doing that?

The issue seems to only happen for code blocks? Maybe?