fix(textStyle): Null-safe parseHTML getting no color/fontFamily from HTMLElement styles (#2825)
* fix(color): parseHTML getting no color get replace of undefined * fix(fontFamily): Null-safe at parseHTML, replace of undefined
This commit is contained in:
@@ -36,7 +36,7 @@ export const Color = Extension.create<ColorOptions>({
|
||||
attributes: {
|
||||
color: {
|
||||
default: null,
|
||||
parseHTML: element => element.style.color.replace(/['"]+/g, ''),
|
||||
parseHTML: element => element.style.color?.replace(/['"]+/g, ''),
|
||||
renderHTML: attributes => {
|
||||
if (!attributes.color) {
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user