mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix math rendering in note revisions, fixes #1359
This commit is contained in:
parent
af41e5d115
commit
8e8148ce42
@ -2,6 +2,7 @@ import utils from '../services/utils.js';
|
|||||||
import server from '../services/server.js';
|
import server from '../services/server.js';
|
||||||
import toastService from "../services/toast.js";
|
import toastService from "../services/toast.js";
|
||||||
import appContext from "../services/app_context.js";
|
import appContext from "../services/app_context.js";
|
||||||
|
import libraryLoader from "../services/library_loader.js";
|
||||||
|
|
||||||
const $dialog = $("#note-revisions-dialog");
|
const $dialog = $("#note-revisions-dialog");
|
||||||
const $list = $("#note-revision-list");
|
const $list = $("#note-revision-list");
|
||||||
@ -132,6 +133,12 @@ async function setContentPane() {
|
|||||||
|
|
||||||
if (revisionItem.type === 'text') {
|
if (revisionItem.type === 'text') {
|
||||||
$content.html(fullNoteRevision.content);
|
$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') {
|
else if (revisionItem.type === 'code') {
|
||||||
$content.html($("<pre>").text(fullNoteRevision.content));
|
$content.html($("<pre>").text(fullNoteRevision.content));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user