Skip to content

Commit

Permalink
fix: Fix removal of textStyle mark when any style resets (#1465)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bttger authored Jun 14, 2021
1 parent 8624505 commit fbf4422
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-text-style/src/text-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fbf4422

Please sign in to comment.