mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-22 01:33:29 +01:00
fix empty nested routes
This commit is contained in:
parent
deefd96159
commit
3898f04c0e
1 changed files with 7 additions and 2 deletions
|
@ -45,12 +45,17 @@ export class CustomFrame {
|
||||||
let src = new URL(this.data.url);
|
let src = new URL(this.data.url);
|
||||||
|
|
||||||
if (urlSuffix) {
|
if (urlSuffix) {
|
||||||
let suffix = new URL(urlSuffix, src);
|
let suffix = new URL(urlSuffix, src.origin);
|
||||||
|
|
||||||
suffix.searchParams.forEach((value, key) => {
|
suffix.searchParams.forEach((value, key) => {
|
||||||
src.searchParams.set(key, value);
|
src.searchParams.set(key, value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (suffix.pathname !== "/") {
|
||||||
|
src.pathname += suffix.pathname;
|
||||||
|
}
|
||||||
|
|
||||||
src.hash = suffix.hash || src.hash;
|
src.hash = suffix.hash || src.hash;
|
||||||
src.pathname += suffix.pathname;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.frame.setAttribute("src", src.toString());
|
this.frame.setAttribute("src", src.toString());
|
||||||
|
|
Loading…
Reference in a new issue