mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
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:
parent
8624505ce1
commit
fbf442269d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user