Skip to content

Commit

Permalink
fix(fontFamily): Null-safe at parseHTML, replace of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
d8vjork committed May 24, 2022
1 parent be2d27e commit 80319d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-font-family/src/font-family.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 80319d0

Please sign in to comment.