support math in read only text notes

This commit is contained in:
zadam 2020-10-19 23:36:57 +02:00
parent 32e3560dce
commit 313b9dba61
3 changed files with 9 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
import treeCache from "../../services/tree_cache.js";
import AbstractTextTypeWidget from "./abstract_text_type_widget.js";
import treeService from "../../services/tree.js";
import libraryLoader from "../../services/library_loader.js";
const TPL = `
<div class="note-detail-readonly-text note-detail-printable">
@ -82,6 +83,12 @@ export default class ReadOnlyTextTypeWidget extends AbstractTextTypeWidget {
this.loadIncludedNote(noteId, $(el));
});
if (this.$content.find('span.math-tex').length > 0) {
await libraryLoader.requireLibrary(libraryLoader.KATEX);
renderMathInElement(this.$content[0], {});
}
}
async refreshIncludedNoteEvent({noteId}) {