fix: Fix removal of textStyle mark when any style resets (#1465)

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.
This commit is contained in:
Tom Boettger 2021-06-14 22:28:16 +02:00 committed by GitHub
parent 8624505ce1
commit fbf442269d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ export const TextStyle = Mark.create<TextStyleOptions>({
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