Skip to content

Commit ea35a64

Browse files
committed
fix(texteditor)[markdown]: enhance falsy dimensions check for images
1 parent ffc5736 commit ea35a64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/utils

contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/utils/markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const paramsToImageMd = ({ src, alt, width, height, permanentSrc }) => {
4343
}
4444

4545
const fileName = sourceToSave.split('/').pop();
46-
if (width && height) {
46+
if (Number.isFinite(+width) && Number.isFinite(+height)) {
4747
return `![${alt || ''}](${IMAGE_PLACEHOLDER}/${fileName} =${width}x${height})`;
4848
}
4949
return `![${alt || ''}](${IMAGE_PLACEHOLDER}/${fileName})`;

0 commit comments

Comments
 (0)