mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 13:09:01 +01:00
fix(export/share): assets incorrectly rewritten
Some checks are pending
Checks / main (push) Waiting to run
Some checks are pending
Checks / main (push) Waiting to run
This commit is contained in:
parent
055fcb7b2a
commit
ba26c478d6
@ -52,7 +52,10 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
|
|||||||
if (note) {
|
if (note) {
|
||||||
content = renderNoteForExport(note, branch, basePath, noteMeta.notePath.slice(0, -1));
|
content = renderNoteForExport(note, branch, basePath, noteMeta.notePath.slice(0, -1));
|
||||||
if (typeof content === "string") {
|
if (typeof content === "string") {
|
||||||
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, "href=\"#root/$1\"");
|
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, (match, id) => {
|
||||||
|
if (match.includes("/assets/")) return match;
|
||||||
|
return `href="#root/${id}"`;
|
||||||
|
});
|
||||||
content = this.rewriteFn(content, noteMeta);
|
content = this.rewriteFn(content, noteMeta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user