This commit is contained in:
Zsolt Viczian
2022-08-04 20:16:58 +02:00
parent cc9d7828c7
commit e7444f5d8a
7 changed files with 18 additions and 12 deletions

View File

@@ -518,12 +518,13 @@ export class EmbeddedFilesLoader {
for(let i=0;i<internalEmbeds.length;i++) {
const el = internalEmbeds[i];
const src = el.getAttribute("src");
if(!src) return;
if(!src) continue;
const width = el.getAttribute("width");
const height = el.getAttribute("height");
const f = app.metadataCache.getFirstLinkpathDest(src,file.path);
if(!f) return;
const embeddedFile = await this.getObsidianImage(f,1);
const ef = new EmbeddedFile(plugin,file.path,src);
//const f = app.metadataCache.getFirstLinkpathDest(src.split("#")[0],file.path);
if(!ef.file) continue;
const embeddedFile = await this.getObsidianImage(ef,1);
const img = createEl("img");
if(width) img.setAttribute("width", width);
if(height) img.setAttribute("height", height);