Skip to content

Commit 9bc53e8

Browse files
committed
fix: RT-264 incorrect condition for width units in images
1 parent c150ad4 commit 9bc53e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/toRedactor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ export const toRedactor = (jsonValue: any,options?:IJsonToHtmlOptions) : string
384384
let width = String(allattrs['width'])
385385

386386
if (width.slice(width.length - 1) === '%') {
387-
allattrs['width'] = String(allattrs['width'])
388-
} else {
389387
allattrs['width'] = allattrs['width'] + '%'
388+
} else {
389+
allattrs['width'] = String(allattrs['width'])
390390
}
391391
// style = `width: ${allattrs['width']}; height: auto;`
392392
}

0 commit comments

Comments
 (0)