mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 21:19:01 +01:00
fix(link): Allow external links containing # to navigate
This commit is contained in:
parent
4ed30e0624
commit
a5ba1b0489
@ -204,11 +204,17 @@ export function parseNavigationStateFromUrl(url: string | undefined) {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
url = url.trim();
|
||||||
const hashIdx = url.indexOf("#");
|
const hashIdx = url.indexOf("#");
|
||||||
if (hashIdx === -1) {
|
if (hashIdx === -1) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exclude external links that contain #
|
||||||
|
if (hashIdx !== 0 && !url.includes("/#root")) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const hash = url.substr(hashIdx + 1); // strip also the initial '#'
|
const hash = url.substr(hashIdx + 1); // strip also the initial '#'
|
||||||
let [notePath, paramString] = hash.split("?");
|
let [notePath, paramString] = hash.split("?");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user