diff --git a/dist/blog/html/multi-modal-transformer.html b/dist/blog/html/multi-modal-transformer.html index 42dc413..32cc058 100644 --- a/dist/blog/html/multi-modal-transformer.html +++ b/dist/blog/html/multi-modal-transformer.html @@ -21,6 +21,21 @@ processHtmlClass: 'arithmatex' } }; + + window.addEventListener('load', function() { + document.querySelectorAll('script[type^="math/tex"]').forEach(function(script) { + const isDisplay = script.type.includes('mode=display'); + const math = script.textContent; + const span = document.createElement('span'); + span.className = isDisplay ? 'mathjax-block' : 'mathjax-inline'; + span.innerHTML = isDisplay ? `\\[${math}\\]` : `\\(${math}\\)`; + script.parentNode.replaceChild(span, script); + }); + + if (typeof MathJax !== 'undefined' && MathJax.typesetPromise) { + MathJax.typesetPromise(); + } + });