mirror of
https://github.com/maradotwebp/obsidian-avatar.git
synced 2026-07-22 07:30:24 +00:00
Merge 08c7b88a25 into 53a4f03995
This commit is contained in:
commit
3499f8d306
1 changed files with 5 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue