Skip to content

Commit 0f80d28

Browse files
luginfCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent cab0bb3 commit 0f80d28

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

zettelkasten/zettelkasten.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ Script {
9595

9696
// Returns the link target string for [[target|id]] given a note object.
9797
function noteLinkTarget(note) {
98+
var name = note && note.name ? note.name : "";
99+
if (name) {
100+
var relativeDir = note.relativeNoteFileDirPath || "";
101+
if (relativeDir) {
102+
relativeDir = relativeDir.replace(/[\/\\]+$/, "");
103+
return relativeDir ? relativeDir + "/" + name : name;
104+
}
105+
return name;
106+
}
107+
98108
return /\.txt$/i.test(note.fileName) ? note.fileName.slice(0, note.fileName.length - 4) : note.fileName;
99109
}
100110

0 commit comments

Comments
 (0)