Skip to content

Commit

Permalink
feat: aaded optional chaining for image text-align style
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayesh2812 committed Sep 26, 2023
1 parent 1c18b5e commit 3cf16bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fromRedactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ const getFinalImageAttributes = ({elementAttrs, newChildren, extraAttrs, sizeAtt
sizeAttrs.width = newChildren[0].attrs.width.toString();
}

const childAttrs = { ...newChildren[0].attrs, ...sizeAttrs, style: { 'text-align': style['text-align'] }, caption: extraAttrs['caption'] }
const childAttrs = { ...newChildren[0].attrs, ...sizeAttrs, style: { 'text-align': style?.['text-align'] }, caption: extraAttrs['caption'] }
extraAttrs = { ...extraAttrs, ...sizeAttrs }

if (!childAttrs.caption) {
Expand Down

0 comments on commit 3cf16bf

Please sign in to comment.