diff --git a/layout/includes/third-party/math/mathjax.pug b/layout/includes/third-party/math/mathjax.pug index f58689e..b784218 100644 --- a/layout/includes/third-party/math/mathjax.pug +++ b/layout/includes/third-party/math/mathjax.pug @@ -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] } } } diff --git a/package.json b/package.json index d9751d2..e10e10b 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/source/css/_layout/third-party.styl b/source/css/_layout/third-party.styl index 8899d24..0d3fc08 100644 --- a/source/css/_layout/third-party.styl +++ b/source/css/_layout/third-party.styl @@ -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