Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down