lib/jazzy/themes/jony/assets/js/jazzy.js in jazzy-0.13.1 vs lib/jazzy/themes/jony/assets/js/jazzy.js in jazzy-0.13.2
- old
+ new
@@ -21,11 +21,11 @@
// On doc load + hash-change, open any targetted item
function openCurrentItemIfClosed() {
if (window.jazzy.docset) {
return;
}
- var $link = $(`.token[href="${location.hash}"]`);
+ var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
$content = itemLinkToContent($link);
if ($content.is(':hidden')) {
toggleItem($link, $content);
}
}
@@ -55,5 +55,16 @@
$("a:not('.token')").on('click', function() {
if (location == this.href) {
openCurrentItemIfClosed();
}
});
+
+// KaTeX rendering
+if ("katex" in window) {
+ $($('.math').each( (_, element) => {
+ katex.render(element.textContent, element, {
+ displayMode: $(element).hasClass('m-block'),
+ throwOnError: false,
+ trust: true
+ });
+ }))
+}