From f0fafbadd4e5d359792922d6303b876866069f84 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Tue, 19 May 2026 10:52:48 +0300 Subject: [PATCH] isolate editor nodes --- app/javascript/template_builder/dynamic_editor.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/javascript/template_builder/dynamic_editor.js b/app/javascript/template_builder/dynamic_editor.js index 79698e17..d83062a4 100644 --- a/app/javascript/template_builder/dynamic_editor.js +++ b/app/javascript/template_builder/dynamic_editor.js @@ -94,6 +94,8 @@ img.ProseMirror-separator { } dynamic-variable { background-color: #fef3c7; + word-break: break-all; + overflow-wrap: anywhere; }`) function collectDomAttrs (dom) { @@ -136,11 +138,12 @@ function collectSpanDomAttrs (dom) { return result } -function createBlockNode (name, tag, content) { +function createBlockNode (name, tag, content, extra = {}) { return Node.create({ name, group: 'block', content: content || 'block+', + ...extra, addAttributes () { return { htmlAttrs: { default: {} } @@ -194,9 +197,9 @@ const CustomHeading = Node.create({ }) const SectionNode = createBlockNode('section', 'section') -const ArticleNode = createBlockNode('article', 'article') -const HeaderNode = createBlockNode('header', 'header') -const FooterNode = createBlockNode('footer', 'footer') +const ArticleNode = createBlockNode('article', 'article', null, { isolating: true }) +const HeaderNode = createBlockNode('header', 'header', null, { isolating: true }) +const FooterNode = createBlockNode('footer', 'footer', null, { isolating: true }) const DivNode = createBlockNode('div', 'div') const BlockquoteNode = createBlockNode('blockquote', 'blockquote') const PreNode = createBlockNode('pre', 'pre')