Bug Post preview loses registered event listeners for rendered bb-code preview

There is a bug in this version
X

Xon

Guest
While technically xf-init is executed, any event listeners are lost probably resulting in the results of xf-init being GC'ed. The problem is the use of innerHTML to copy data into the DOM, as this creates new nodes and doesn't move/copy the existing nodes.

This is noticeable for custom bb-code which has xf-init handlers, and xf-init is executed on content which is then dropped.

Code:

Code:
function toPreview (previewHtml)
{
    const previewBox = getPreviewBox()...

Read more

Continue reading...