Skip to content

Build your personal knowledge base with Trilium Notes

Add temporary flickering fix

Sauli Anto8e00885b2921
diff --git a/src/utils.js b/src/utils.js
index fcd6825811..ce9412cd23 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -28,15 +28,15 @@ export function renderEquation( equation, element, engine = 'katex', display = f
MathJax.startup.document.updateDocument();
} );
} else {
- if ( display ) {
- element.innerHTML = '\\[' + equation + '\\]';
- } else {
- element.innerHTML = '\\(' + equation + '\\)';
- }
- // Fixme: MathJax render occasionally math processing error without timeout
+ // Fixme: MathJax typesetting cause occasionally math processing error without timeout
setTimeout( () => {
+ if ( display ) {
+ element.innerHTML = '\\[' + equation + '\\]';
+ } else {
+ element.innerHTML = '\\(' + equation + '\\)';
+ }
MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, element ] );
- }, 100);
+ }, 50);
}
} else if ( engine === 'katex' && typeof katex !== 'undefined' ) {
katex.render( equation, element, {