blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.24k stars 1.25k forks source link

hexo 7.3 代码块显示问题 #928

Open sustcsugar opened 1 month ago

sustcsugar commented 1 month ago

配置如下:

image

主题中code的配置如下:

image

最终的效果如下图所示,代码块会自动换行,下方的滑动条也消失不见,同时也没有行号的显示:

image

按照网上的教程,修改了prism.css文件,添加了关于line-number的设置,行号显示了,但是又有新问题,文本选择的高亮范围和实际的行高不一致,如下图: image

xucanxx commented 1 month ago

我也有行高显示异常这个问题,只要使用仓库中的prism.min.js与prism.min.css这个问题就会出现

xucanxx commented 4 weeks ago

我在 prism.min.css 中 把 pre[class=language-].line-numbers>code { position: relative; white-space: inherit } 改成 pre[class=language-].line-numbers>code { position: sticky; white-space: inherit } 就可以了,我也不知道为啥