Skip to content

Commit

Permalink
fix: 修復 mathjax 行內公式 導致行距過密的 bug
Browse files Browse the repository at this point in the history
fix: 修復更新mathjax 新版本後,mathjax 會溢出屏幕而不是顯示滾動條的 bug
improvement: 避免沒更新主題文件而導致 anchor 配置報錯的問題
improvement: 更新 plugins.yml
  • Loading branch information
jerryc127 committed Oct 30, 2022
1 parent 21f71cd commit 5c0d578
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/head/config.pug
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ script.
},
isPhotoFigcaption: !{theme.photofigcaption},
islazyload: !{theme.lazyload.enable},
isAnchor: !{theme.anchor.auto_update}
isAnchor: !{theme.anchor.auto_update || false}
}
11 changes: 5 additions & 6 deletions layout/includes/third-party/math/mathjax.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ script.
tags: 'ams'
},
chtml: {
scale: 1.2
scale: 1.1
},
options: {
renderActions: {
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions source/css/_layout/third-party.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c0d578

Please sign in to comment.