fix(export/share): tree not expanding properly

This commit is contained in:
Elian Doran
2025-06-24 17:44:47 +03:00
parent 413137ac64
commit a2110ca631
4 changed files with 19 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
import { join } from "path";
import NoteMeta, { NoteMetaFile } from "../../meta/note_meta";
import { ZipExportProvider } from "./abstract_provider";
import { ZipExportProvider } from "./abstract_provider.js";
import { RESOURCE_DIR } from "../../resource_dir";
import { getResourceDir, isDev } from "../../utils";
import fs from "fs";
@@ -50,7 +50,7 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
const basePath = "../".repeat(noteMeta.notePath.length - 1);
if (note) {
content = renderNoteForExport(note, branch, basePath);
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);
}