From b2bc58b9d880443f81ef418eec0cad41155fd811 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Thu, 15 Jan 2026 03:55:18 +0100 Subject: [PATCH] asdasd --- public/editor/bridge-core.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/editor/bridge-core.js b/public/editor/bridge-core.js index 1ec244b..b726696 100644 --- a/public/editor/bridge-core.js +++ b/public/editor/bridge-core.js @@ -743,7 +743,7 @@ }; const setupPlainTextPreserver = (editor) => { - const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link'))); + const isTextLike = (model) => !!(model && model.is && (model.is('text') || model.is('button') || model.is('link') || model.is('textnode'))); const lastContent = new Map(); const normalizeHtml = (value) => { return String(value || '') @@ -752,8 +752,9 @@ .trim(); }; const snapshotContent = (model) => { + const rawContent = model && model.get ? model.get('content') : ''; const el = model.view && model.view.el; - const html = String(model.get ? (model.get('content') || '') : '').trim(); + const html = String(rawContent || '').trim(); const inner = el && el.innerHTML ? String(el.innerHTML).trim() : ''; const text = el && el.textContent ? String(el.textContent).trim() : ''; const composite = html || inner || text; @@ -788,6 +789,10 @@ editor.on('component:update', (model) => restoreIfEmpty(model)); editor.on('component:input', (model) => restoreIfEmpty(model)); editor.on('component:add', (model) => rememberIfPresent(model)); + editor.on('rte:disable', (model) => { + const target = model || (editor.getSelected && editor.getSelected()); + rememberIfPresent(target); + }); }; const setupTableBuilder = (editor) => {