Skip to content

Commit 05cdda2

Browse files
committed
feat: added trim while checking for json string
1 parent ba511e4 commit 05cdda2

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
@@ -799,7 +799,7 @@ const getFinalImageAttributes = ({elementAttrs, newChildren, extraAttrs, sizeAtt
799799

800800
const getNestedValueIfAvailable = (value: string) => {
801801
try {
802-
if (typeof value === "string" && value.match(/^{|\[/i)) {
802+
if (typeof value === "string" && value.trim().match(/^{|\[/i)) {
803803
return JSON.parse(value);
804804
}
805805
return value

0 commit comments

Comments
 (0)