Skip to content

Commit d6099e7

Browse files
committed
remove image markdown when upload image fail
1 parent 9c5bf36 commit d6099e7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/commands/default-commands/save-image-command.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ export const saveImageCommand: Command = {
7878
end: initialState.selection.start + placeHolder.length
7979
});
8080

81-
const realImageMarkdown = `${breaksBefore}![image](${imageUrl})`;
82-
81+
const realImageMarkdown = imageUrl ? `${breaksBefore}![image](${imageUrl})` : "";
8382
const selectionDelta = realImageMarkdown.length - placeHolder.length;
8483

8584
textApi.replaceSelection(realImageMarkdown);

0 commit comments

Comments
 (0)