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 FontFamily = Extension.create<FontFamilyOptions>({
|
||||
attributes: {
|
||||
fontFamily: {
|
||||
default: null,
|
||||
parseHTML: element => element.style.fontFamily.replace(/['"]+/g, ''),
|
||||
parseHTML: element => element.style.fontFamily?.replace(/['"]+/g, ''),
|
||||
renderHTML: attributes => {
|
||||
if (!attributes.fontFamily) {
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user