Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo 7.3 代码块显示问题 #928

Open
sustcsugar opened this issue Aug 13, 2024 · 2 comments
Open

hexo 7.3 代码块显示问题 #928

sustcsugar opened this issue Aug 13, 2024 · 2 comments

Comments

@sustcsugar
Copy link

配置如下:
image
主题中code的配置如下:
image

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

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

@xucanxx
Copy link

xucanxx commented Aug 28, 2024

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

@xucanxx
Copy link

xucanxx commented Aug 29, 2024

我在 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
}
就可以了,我也不知道为啥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants