Skip to content

Commit 4530593

Browse files
authored
Merge pull request nubasedev#284 from thaichor/remove-markdown-when-save-image-return-false
remove image markdown when upload image fail
2 parents 7fc25dd + d6099e7 commit 4530593

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
@@ -79,8 +79,7 @@ export const saveImageCommand: Command = {
7979
end: initialState.selection.start + placeHolder.length
8080
});
8181

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

8685
textApi.replaceSelection(realImageMarkdown);

0 commit comments

Comments
 (0)