Skip to content

Commit

Permalink
fix(markup): fix image paste by link with title from popup (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
St1ggy authored Nov 14, 2024
1 parent 4646c97 commit a291ae9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/markup/commands/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? ''}`;
}

Expand Down

0 comments on commit a291ae9

Please sign in to comment.