From 176333455b35d210c96d081c285bad15d887d22e Mon Sep 17 00:00:00 2001 From: Yi JiHong <0125ses@hanmail.net> Date: Tue, 30 May 2023 16:25:34 +0900 Subject: [PATCH] fix: #1213 backspace style format --- src/lib/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core.js b/src/lib/core.js index 0ac719ea..2fdc3869 100755 --- a/src/lib/core.js +++ b/src/lib/core.js @@ -6955,8 +6955,8 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re } // clean remove tag - if (formatEl && range.startContainer === range.endContainer && selectionNode.nodeType === 3 && !util.isFormatElement(selectionNode.parentNode)) { - if (range.collapsed ? selectionNode.textContent.length === 1 : (range.endOffset - range.startOffset) === selectionNode.textContent.length) { + if (!formatEl.previousElementSibling && formatEl && range.startContainer === range.endContainer && selectionNode.nodeType === 3 && !util.isFormatElement(selectionNode.parentNode)) { + if (range.collapsed ? selectionNode.textContent.length === 0 : (range.endOffset - range.startOffset) === selectionNode.textContent.length) { e.preventDefault(); let offset = null;