I’m not sure if this is a bug or what, but there’s something unexpected going on.
I’ve set up a test for you to see here: https://perchance.org/sxvghvl53i#edit
I’ve got an $output that creates HTML, which contains the code [
, but escaped so that it’s not processed. So: ]\[a.html\]
.
This is then injected into the page, and actually processed correctly, replacing the contents with the a.html value. But then calling update() on that element either does nothing or throws an error of one kind or another.
It says that a_elem is undefined, when it should have already been injected into the page.
Honestly, I’ve been fiddling with this test for a while now and I can’t quite pin down exactly how it works or what this works and that doesn’t or what order things are being processed in… But some sort of shenanigans is going on.
If this is all working as expected, I’d love to learn how it works. But if not, consider this a bug report 😅