From e21533a3d1cfeecde562aaa6c52ee306e5063a01 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 17 Jun 2024 21:36:28 +0800 Subject: [PATCH] feat: add clear format attributes --- src/editor/core/command/CommandAdapt.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/editor/core/command/CommandAdapt.ts b/src/editor/core/command/CommandAdapt.ts index 257c0fc..87b72cc 100644 --- a/src/editor/core/command/CommandAdapt.ts +++ b/src/editor/core/command/CommandAdapt.ts @@ -323,13 +323,9 @@ export class CommandAdapt { } if (!changeElementList.length) return changeElementList.forEach(el => { - delete el.size - delete el.font - delete el.color - delete el.bold - delete el.italic - delete el.underline - delete el.strikeout + EDITOR_ELEMENT_STYLE_ATTR.forEach(attr => { + delete el[attr] + }) }) this.draw.render(renderOption) }