fix math rendering in note revisions, fixes #1359

This commit is contained in:
zadam 2020-10-30 15:06:11 +01:00
parent af41e5d115
commit 8e8148ce42

View file

@ -2,6 +2,7 @@ import utils from '../services/utils.js';
import server from '../services/server.js';
import toastService from "../services/toast.js";
import appContext from "../services/app_context.js";
import libraryLoader from "../services/library_loader.js";
const $dialog = $("#note-revisions-dialog");
const $list = $("#note-revision-list");
@ -132,6 +133,12 @@ async function setContentPane() {
if (revisionItem.type === 'text') {
$content.html(fullNoteRevision.content);
if ($content.find('span.math-tex').length > 0) {
await libraryLoader.requireLibrary(libraryLoader.KATEX);
renderMathInElement($content[0], {});
}
}
else if (revisionItem.type === 'code') {
$content.html($("<pre>").text(fullNoteRevision.content));