fix: render of katex (#390)

This commit is contained in:
YangFong 2024-09-08 09:45:59 +08:00 committed by GitHub
parent 744785bd84
commit 33206c7857
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 12 deletions

View File

@ -15,12 +15,6 @@
rel="apple-touch-icon-precomposed" rel="apple-touch-icon-precomposed"
href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png" href="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/md/images/1648303220922-7e14aefa-816e-44c1-8604-ade709ca1c69.png"
/> />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css"
integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+"
crossorigin="anonymous"
/>
<style> <style>
.loading { .loading {
position: fixed; position: fixed;
@ -93,11 +87,12 @@
</script> </script>
<script> <script>
MathJax = { MathJax = {
loader: { load: ['[tex]/ams'] },
tex: { packages: { '[+]': ['ams'] }, tags: 'ams' },
svg: { fontCache: 'none' }, svg: { fontCache: 'none' },
tex: { tags: 'ams' },
} }
</script> </script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script> <script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
<script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/wechatsync/article-syncjs@latest/dist/main.js"></script> <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/wechatsync/article-syncjs@latest/dist/main.js"></script>

View File

@ -16,9 +16,8 @@ function createRenderer(display) {
if (display) { if (display) {
return `<section style="text-align: center; overflow: auto;">${svg.outerHTML}</section>` return `<section style="text-align: center; overflow: auto;">${svg.outerHTML}</section>`
} }
else {
return `<span style="display: inline-block; vertical-align: middle; line-height: 1;">${svg.outerHTML}</span>` return `<span style="vertical-align: middle; line-height: 1;">${svg.outerHTML}</span>`
}
} }
} }