Skip to content

Commit ba26c47

Browse files
committed
fix(export/share): assets incorrectly rewritten
1 parent 055fcb7 commit ba26c47

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/server/src/services/export/zip/share_theme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
5252
if (note) {
5353
content = renderNoteForExport(note, branch, basePath, noteMeta.notePath.slice(0, -1));
5454
if (typeof content === "string") {
55-
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, "href=\"#root/$1\"");
55+
content = content.replace(/href="[^"]*\.\/([a-zA-Z0-9_\/]{12})[^"]*"/g, (match, id) => {
56+
if (match.includes("/assets/")) return match;
57+
return `href="#root/${id}"`;
58+
});
5659
content = this.rewriteFn(content, noteMeta);
5760
}
5861
}

0 commit comments

Comments
 (0)