Allow Latex equations in homepage banners and part comment.

This commit is contained in:
Jan Böhmer 2020-03-15 15:48:01 +01:00
parent 9dc5d325da
commit 562db6da06
5 changed files with 28 additions and 18 deletions

View file

@ -811,7 +811,7 @@ div.dataTables_wrapper div.dataTables_info {
padding: 10px 10px;
margin: 0 0 10px;
font-size: 17.5px;
border-left: 5px solid #eee;
border-left: 5px solid #aaa;
}
.darkmode-layer {

View file

@ -465,6 +465,19 @@ $(document).on("ajaxUI:start", function () {
//Bootstrapify objects
$('table', this).addClass('table table-hover table-striped table-bordered');
});
//Latex rendering have to be done after markdown parsing
$('.latex').each(function(index, element) {
//@ts-ignore
window.renderMathInElement(element, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
}
//Configure markdown
@ -552,20 +565,6 @@ $(document).on("ajaxUI:reload", function() {
})
});
//Register latex rendering
$(document).on("ajaxUI:reload ajaxUI:start", function() {
$('.latex').each(function(index, element) {
//@ts-ignore
window.renderMathInElement(element, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false},
{left: "\\(", right: "\\)", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
});
//Need for proper body padding, with every navbar height
$(window).resize(function () {