This commit is contained in:
Buwwet 2025-08-31 16:56:32 +00:00 committed by GitHub
commit 3499f8d306
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@
MarkdownPostProcessorContext,
MarkdownRenderer,
MarkdownView,
Platform,
TFile,
} from "obsidian";
import Fab from "./Fab.svelte";
@ -111,6 +112,10 @@
}
function normalizeImgPath(src: string): string {
// Check if the path is an external local file
if (src.startsWith("file://")) {
return src.replace("file://", Platform.resourcePathPrefix);
}
const file = app.vault.getAbstractFileByPath(src);
if (file && file instanceof TFile) {
return app.vault.getResourcePath(file);