fix: 修復 inline mathjax 有滾動條的 bug

This commit is contained in:
Jerry 2021-07-06 15:52:21 +08:00
parent 3f796adc88
commit eca1487a5e
3 changed files with 14 additions and 7 deletions

View File

@ -21,7 +21,17 @@ script.
math.end = {node: text, delim: '', n: 0}
doc.math.push(math)
}
}, '']
}, ''],
insertScript: [200, () => {
document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
const target = node.parentNode
if (target.nodeName.toLowerCase() === 'li') {
target.parentNode.classList.add('has-jax')
} else {
target.classList.add('has-jax')
}
});
}, '', false]
}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "3.8.0",
"version": "3.8.1-b1",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {

View File

@ -90,14 +90,11 @@ if hexo-config('waline.bg')
display: none
// mathjax
mjx-container
mjx-container[display],
.has-jax
overflow-x: auto
overflow-y: hidden
&:not([display])
display: inline-grid
max-width: 100%
.aplayer
color: $font-black