From 2a6a98dfb6aed11e05ac40d222d21fa849b14b76 Mon Sep 17 00:00:00 2001 From: Tom Boettger Date: Mon, 14 Jun 2021 10:09:35 +0200 Subject: [PATCH] Fix removal of textStyle mark when any style resets I built some extensions based on the textStyle extension but whenever I reset a style/attribute, the whole textStyle mark gets removed when there are still other styles defined in the mark. --- packages/extension-text-style/src/text-style.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-text-style/src/text-style.ts b/packages/extension-text-style/src/text-style.ts index cf4122a70..d1187cb18 100644 --- a/packages/extension-text-style/src/text-style.ts +++ b/packages/extension-text-style/src/text-style.ts @@ -51,7 +51,7 @@ export const TextStyle = Mark.create({ return { removeEmptyTextStyle: () => ({ state, commands }) => { const attributes = getMarkAttributes(state, this.type) - const hasStyles = Object.entries(attributes).every(([, value]) => !!value) + const hasStyles = Object.entries(attributes).some(([, value]) => !!value) if (hasStyles) { return true