fix(export/share): use right extension for images

This commit is contained in:
Elian Doran
2025-06-24 19:53:21 +03:00
parent 06de06b501
commit fded714f18
3 changed files with 22 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import { join } from "path";
import NoteMeta, { NoteMetaFile } from "../../meta/note_meta";
import { ZipExportProvider } from "./abstract_provider.js";
import { ExportFormat, ZipExportProvider } from "./abstract_provider.js";
import { RESOURCE_DIR } from "../../resource_dir";
import { getResourceDir, isDev } from "../../utils";
import fs from "fs";
@@ -65,6 +65,14 @@ export default class ShareThemeExportProvider extends ZipExportProvider {
this.#saveIndex(rootMeta);
}
mapExtension(type: string | null, mime: string, existingExtension: string, format: ExportFormat): string | null {
if (mime.startsWith("image/")) {
return null;
}
return "html";
}
#saveIndex(rootMeta: NoteMeta) {
if (!this.indexMeta?.dataFileName) {
return;