Skip to content

Commit a291ae9

Browse files
authored
fix(markup): fix image paste by link with title from popup (#474)
1 parent 4646c97 commit a291ae9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/markup/commands/inline.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ export function insertImages(images: ImageItem[]): StateCommand {
3535
let result = `![${alt ?? ''}](${url ?? ''}`;
3636

3737
if (title) {
38-
result += ` "${title}`;
38+
result += ` "${title}"`;
3939
}
4040

41-
if (width !== undefined || height !== undefined) {
41+
if (
42+
(width !== undefined && width.length > 0) ||
43+
(height !== undefined && height.length > 0)
44+
) {
4245
result += ` =${width ?? ''}x${height ?? ''}`;
4346
}
4447

0 commit comments

Comments
 (0)