From c98da9143f07775db1880db4703d856c684ad2bf Mon Sep 17 00:00:00 2001 From: feruz <fmiboy@gmail.com> Date: Wed, 22 Jun 2022 22:41:36 +0300 Subject: [PATCH] fix image insert issue --- src/components/markdownEditor/view/formats/applyMediaLink.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/markdownEditor/view/formats/applyMediaLink.ts b/src/components/markdownEditor/view/formats/applyMediaLink.ts index 28b5c5ec1..9be6a4a85 100644 --- a/src/components/markdownEditor/view/formats/applyMediaLink.ts +++ b/src/components/markdownEditor/view/formats/applyMediaLink.ts @@ -7,7 +7,7 @@ export default async ({ text, selection, setTextAndSelection, items }) => { let newSelection = selection; items.forEach(item => { - if(item.url && item.text){ + if(item.url){ const formatedText = `\n${imagePrefix}[${item.text}](${item.url})\n` newText = replaceBetween(newText, newSelection, formatedText); const newIndex = newText && newText.indexOf(item.url, newSelection.start) + item.url.length + 2;