From 8e8148ce42cb8ce88f8278b664d060fc0ba87e23 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 30 Oct 2020 15:06:11 +0100 Subject: [PATCH] fix math rendering in note revisions, fixes #1359 --- src/public/app/dialogs/note_revisions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/public/app/dialogs/note_revisions.js b/src/public/app/dialogs/note_revisions.js index c7f42e674..39bdd2ea2 100644 --- a/src/public/app/dialogs/note_revisions.js +++ b/src/public/app/dialogs/note_revisions.js @@ -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($("
").text(fullNoteRevision.content));