From a291ae9786fc952a04eff831466833ac053df5de Mon Sep 17 00:00:00 2001 From: Dmitrii Bragin Date: Thu, 14 Nov 2024 11:43:59 +0300 Subject: [PATCH] fix(markup): fix image paste by link with title from popup (#474) --- src/markup/commands/inline.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/markup/commands/inline.ts b/src/markup/commands/inline.ts index 2e2a0008..8890f22e 100644 --- a/src/markup/commands/inline.ts +++ b/src/markup/commands/inline.ts @@ -35,10 +35,13 @@ export function insertImages(images: ImageItem[]): StateCommand { let result = `![${alt ?? ''}](${url ?? ''}`; if (title) { - result += ` "${title}`; + result += ` "${title}"`; } - if (width !== undefined || height !== undefined) { + if ( + (width !== undefined && width.length > 0) || + (height !== undefined && height.length > 0) + ) { result += ` =${width ?? ''}x${height ?? ''}`; }