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} math.end = {node: text, delim: '', n: 0}
doc.math.push(math) 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", "name": "hexo-theme-butterfly",
"version": "3.8.0", "version": "3.8.1-b1",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {

View File

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