From 5c0d578e4cc23f54bb4bc459896aa333084dd670 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 31 Oct 2022 00:09:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=BE=A9=20mathjax=20=E8=A1=8C?= =?UTF-8?q?=E5=85=A7=E5=85=AC=E5=BC=8F=20=E5=B0=8E=E8=87=B4=E8=A1=8C?= =?UTF-8?q?=E8=B7=9D=E9=81=8E=E5=AF=86=E7=9A=84=20bug=20fix:=20=E4=BF=AE?= =?UTF-8?q?=E5=BE=A9=E6=9B=B4=E6=96=B0mathjax=20=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=BE=8C=EF=BC=8Cmathjax=20=E6=9C=83=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E5=B1=8F=E5=B9=95=E8=80=8C=E4=B8=8D=E6=98=AF=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=E6=BB=BE=E5=8B=95=E6=A2=9D=E7=9A=84=20bug=20improveme?= =?UTF-8?q?nt:=20=E9=81=BF=E5=85=8D=E6=B2=92=E6=9B=B4=E6=96=B0=E4=B8=BB?= =?UTF-8?q?=E9=A1=8C=E6=96=87=E4=BB=B6=E8=80=8C=E5=B0=8E=E8=87=B4=20anchor?= =?UTF-8?q?=20=E9=85=8D=E7=BD=AE=E5=A0=B1=E9=8C=AF=E7=9A=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=20improvement:=20=E6=9B=B4=E6=96=B0=20plugins.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 10 ++++++++++ layout/includes/head/config.pug | 2 +- layout/includes/third-party/math/mathjax.pug | 11 +++++------ package.json | 2 +- plugins.yml | 10 +++++----- source/css/_layout/third-party.styl | 12 ++++++++---- 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 10fd0bb..4f260da 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -16,6 +16,16 @@ body: validations: required: true + - type: dropdown + id: modify + attributes: + label: 是否修改过主题文件? || Has the theme files been modified? + options: + - 是 (Yes) + - 不是 (No) + validations: + required: true + - type: dropdown id: browser attributes: diff --git a/layout/includes/head/config.pug b/layout/includes/head/config.pug index 4bcff8f..5a8b8f5 100644 --- a/layout/includes/head/config.pug +++ b/layout/includes/head/config.pug @@ -120,5 +120,5 @@ script. }, isPhotoFigcaption: !{theme.photofigcaption}, islazyload: !{theme.lazyload.enable}, - isAnchor: !{theme.anchor.auto_update} + isAnchor: !{theme.anchor.auto_update || false} } diff --git a/layout/includes/third-party/math/mathjax.pug b/layout/includes/third-party/math/mathjax.pug index 688e6dc..229d472 100644 --- a/layout/includes/third-party/math/mathjax.pug +++ b/layout/includes/third-party/math/mathjax.pug @@ -7,7 +7,7 @@ script. tags: 'ams' }, chtml: { - scale: 1.2 + scale: 1.1 }, options: { renderActions: { @@ -23,12 +23,11 @@ script. } }, ''], 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') + document.querySelectorAll('mjx-container').forEach(node => { + if (node.hasAttribute('display')) { + btf.wrap(node, 'div', { class: 'mathjax-overflow' }) } else { - target.classList.add('has-jax') + btf.wrap(node, 'span', { class: 'mathjax-overflow' }) } }); }, '', false] diff --git a/package.json b/package.json index bc1c701..38882af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "4.5.0", + "version": "4.5.1", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/plugins.yml b/plugins.yml index 537d9e7..9590b68 100644 --- a/plugins.yml +++ b/plugins.yml @@ -5,7 +5,7 @@ algolia_search_v4: instantsearch_v4: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.48.1 + version: 4.49.0 pjax: name: pjax file: pjax.min.js @@ -64,12 +64,12 @@ katex: name: katex file: dist/katex.min.css other_name: KaTeX - version: 0.16.2 + version: 0.16.3 katex_copytex: name: katex file: dist/contrib/copy-tex.min.js other_name: KaTeX - version: 0.16.2 + version: 0.16.3 mermaid: name: mermaid file: dist/mermaid.min.js @@ -183,11 +183,11 @@ prismjs_autoloader: artalk_js: name: artalk file: dist/Artalk.js - version: 2.4.2 + version: 2.4.3 artalk_css: name: artalk file: dist/Artalk.css - version: 2.4.2 + version: 2.4.3 pace_js: name: pace-js other_name: pace diff --git a/source/css/_layout/third-party.styl b/source/css/_layout/third-party.styl index a90fa5d..bc2bd51 100644 --- a/source/css/_layout/third-party.styl +++ b/source/css/_layout/third-party.styl @@ -81,12 +81,16 @@ if hexo-config('waline.bg') &::-webkit-scrollbar display: none -// mathjax -mjx-container[display], -.has-jax +// Mathjax +.mathjax-overflow overflow-x: auto overflow-y: hidden - line-height: normal !important + +span.mathjax-overflow + display: inline-block + padding: 0 2px + max-width: 100% + vertical-align: bottom .aplayer color: $font-black