refactor(share): use a string cache for templates

This commit is contained in:
Elian Doran
2025-06-24 18:08:29 +03:00
parent bc4643fed2
commit 3a55490bbf
2 changed files with 13 additions and 3 deletions

View File

@@ -51,8 +51,10 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
if (note) {
content = renderNoteForExport(note, branch, basePath, noteMeta.notePath.slice(0, -1));
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, "href=\"#root/$1\"");
content = this.rewriteFn(content, noteMeta);
if (typeof content === "string") {
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, "href=\"#root/$1\"");
content = this.rewriteFn(content, noteMeta);
}
}
return content;