feat: parseHTML for attributes should return the value instead of an object now, fix #1863
This commit is contained in:
@@ -34,6 +34,7 @@ export const Color = Extension.create<ColorOptions>({
|
||||
attributes: {
|
||||
color: {
|
||||
default: null,
|
||||
parseHTML: element => element.style.color.replace(/['"]+/g, ''),
|
||||
renderHTML: attributes => {
|
||||
if (!attributes.color) {
|
||||
return {}
|
||||
@@ -43,11 +44,6 @@ export const Color = Extension.create<ColorOptions>({
|
||||
style: `color: ${attributes.color}`,
|
||||
}
|
||||
},
|
||||
parseHTML: element => {
|
||||
return {
|
||||
color: element.style.color.replace(/['"]+/g, ''),
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user