diff --git a/main.ts b/main.ts index 3b6a1a1..1ef19fd 100644 --- a/main.ts +++ b/main.ts @@ -326,13 +326,22 @@ export default class Waypoint extends Plugin { } const fmTitle: string | undefined = this.getTitleFromFrontMatter(node); // Print the file name - if (node.extension == "md" || node.extension == "base") { + if (node.extension == "md" || node.extension == "base" || node.extension == "canvas") { const isBase = node.extension === "base"; + const isCanvas = node.extension === "canvas" + if (this.settings.useWikiLinks) { - // Base links require the extension for some reason - const nodeName = isBase ? node.basename + ".base" : node.basename; - // Hide ".base" from the title if not otherwise specified - const title = isBase && !fmTitle ? node.basename : fmTitle; + // Base and Canvas links require the extension for some reason + const nodeName = + isBase ? node.basename + ".base" + : isCanvas ? node.basename + ".canvas" + : node.basename; + + // Hide ".base", ".canvas" from the title if not otherwise specified + const title = isBase && !fmTitle ? node.basename + : isCanvas && !fmTitle ? node.basename + : fmTitle; + if (title) { return `${bullet} [[${nodeName}|${title}]]`; } else {