hopefully fix #94
This commit is contained in:
parent
b4d499e0e4
commit
15fc591b83
4 changed files with 16 additions and 6 deletions
|
|
@ -47,16 +47,20 @@ export class MediaDbPreviewModal extends Modal {
|
|||
|
||||
const previewWrapper = contentEl.createDiv({ cls: 'media-db-plugin-preview-wrapper' });
|
||||
|
||||
this.markdownComponent.load();
|
||||
|
||||
for (const result of this.elements) {
|
||||
previewWrapper.createEl('h3', { text: result.englishTitle });
|
||||
const fileDiv = previewWrapper.createDiv();
|
||||
const fileDiv = previewWrapper.createDiv({ cls: 'media-db-plugin-preview'});
|
||||
|
||||
let fileContent = await this.plugin.generateMediaDbNoteContents(result, this.createNoteOptions);
|
||||
fileContent = `\n${fileContent}\n`;
|
||||
|
||||
this.markdownComponent.load();
|
||||
|
||||
MarkdownRenderer.renderMarkdown(fileContent, fileDiv, null, this.markdownComponent);
|
||||
try {
|
||||
await MarkdownRenderer.renderMarkdown(fileContent, fileDiv, "", this.markdownComponent);
|
||||
} catch (e) {
|
||||
console.warn(`mdb | error during rendering of preview`, e);
|
||||
}
|
||||
}
|
||||
|
||||
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue