Skip to content

Commit

Permalink
fix: #1213 backspace style format
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed May 30, 2023
1 parent 1693c0d commit 1763334
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1763334

Please sign in to comment.