1
0
This commit is contained in:
Zef Hemel 2022-08-29 15:40:38 +02:00
parent 9cf5984319
commit ff24358269

View File

@ -1,5 +1,6 @@
import type { ClickEvent } from "@silverbulletmd/web/app_event"; import type { ClickEvent } from "@silverbulletmd/web/app_event";
import { import {
flashNotification,
getCursor, getCursor,
getText, getText,
navigate as navigateTo, navigate as navigateTo,
@ -28,7 +29,11 @@ async function actionClickOrActionEnter(mdTree: ParseTree | null) {
await openUrl(mdTree.children![0].text!); await openUrl(mdTree.children![0].text!);
break; break;
case "Link": case "Link":
await openUrl(mdTree.children![4].children![0].text!); const url = mdTree.children![4].children![0].text!;
if (url.length <= 1) {
return flashNotification("Empty link, ignoring", "error");
}
await openUrl(url);
break; break;
case "CommandLink": case "CommandLink":
let command = mdTree let command = mdTree