Skip to content

Commit 3cf16bf

Browse files
committed
feat: aaded optional chaining for image text-align style
1 parent 1c18b5e commit 3cf16bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fromRedactor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ const getFinalImageAttributes = ({elementAttrs, newChildren, extraAttrs, sizeAtt
782782
sizeAttrs.width = newChildren[0].attrs.width.toString();
783783
}
784784

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

788788
if (!childAttrs.caption) {

0 commit comments

Comments
 (0)