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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user