diff --git a/app/javascript/editor/editor.ts b/app/javascript/editor/editor.ts index a3919c8..b9e1e9f 100644 --- a/app/javascript/editor/editor.ts +++ b/app/javascript/editor/editor.ts @@ -56,12 +56,12 @@ function fixContent (editor: Editor, node: Element = editor.contentEl): void { el => el.contains(node) ) if (!parentEl) throw new Error('no encontré lx pariente') + targetEl.insertBefore(figureEl, parentEl) const innerEl = figureEl.querySelector('[data-multimedia-inner]') if (!innerEl) throw new Error('Raro.') figureEl.replaceChild(node, innerEl) - targetEl.insertBefore(figureEl, parentEl) node = figureEl }