More fixes related to #363
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
nodeAtPos,
|
||||
ParseTree,
|
||||
} from "$sb/lib/tree.ts";
|
||||
import { resolvePath } from "$sb/lib/resolve.ts";
|
||||
import { resolveAttachmentPath, resolvePath } from "$sb/lib/resolve.ts";
|
||||
|
||||
async function actionClickOrActionEnter(
|
||||
mdTree: ParseTree | null,
|
||||
@@ -79,7 +79,9 @@ async function actionClickOrActionEnter(
|
||||
return editor.flashNotification("Empty link, ignoring", "error");
|
||||
}
|
||||
if (url.indexOf("://") === -1 && !url.startsWith("mailto:")) {
|
||||
return editor.openUrl(resolvePath(currentPage, decodeURI(url)));
|
||||
return editor.openUrl(
|
||||
resolveAttachmentPath(currentPage, decodeURI(url)),
|
||||
);
|
||||
} else {
|
||||
await editor.openUrl(url);
|
||||
}
|
||||
@@ -93,8 +95,11 @@ async function actionClickOrActionEnter(
|
||||
try {
|
||||
const args = argsText ? JSON.parse(`[${argsText}]`) : [];
|
||||
await system.invokeCommand(commandName, args);
|
||||
} catch(e: any) {
|
||||
await editor.flashNotification(`Error parsing command link arguments: ${e.message}`, "error");
|
||||
} catch (e: any) {
|
||||
await editor.flashNotification(
|
||||
`Error parsing command link arguments: ${e.message}`,
|
||||
"error",
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user