From 89e319c7a2913801a2a79d1dfd9d458e347dbe2b Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 14 Nov 2022 20:30:52 +0100 Subject: [PATCH] fix backlink generation for drag & dropped links, fixes #3314 --- src/public/app/services/link.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js index fabfc2628..6c428dcd6 100644 --- a/src/public/app/services/link.js +++ b/src/public/app/services/link.js @@ -17,6 +17,12 @@ async function createNoteLink(notePath, options = {}) { return $("").text("[missing note]"); } + if (!notePath.startsWith("root")) { + // all note paths should start with "root/" (except for "root" itself) + // used e.g. to find internal links + notePath = "root/" + notePath; + } + let noteTitle = options.title; const showTooltip = options.showTooltip === undefined ? true : options.showTooltip; const showNotePath = options.showNotePath === undefined ? false : options.showNotePath;