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

hexo7.1.1代码显示问题 #910

Open
YiJieLiuHub opened this issue Jan 24, 2024 · 5 comments
Open

hexo7.1.1代码显示问题 #910

YiJieLiuHub opened this issue Jan 24, 2024 · 5 comments

Comments

@YiJieLiuHub
Copy link

image
配置如下:

syntax_highlighter: prismjs
highlight:
  auto_detect: false
  line_number: true
  line_threshold: 0
  tab_replace: ''
  exclude_languages:
    - example
  wrap: true
  hljs: false
prismjs:
  preprocess: true
  line_number: true
  line_threshold: 0
  tab_replace: ''
@YiJieLiuHub
Copy link
Author

以上问题已经解决,但是渲染不了Vue代码
image

@yanhuacuo
Copy link

目前看,只能降级

@yanhuacuo
Copy link

yanhuacuo commented Feb 6, 2024

prism.zip

解决办法

博客根目录中使用新参数

根目录的 _config.yaml 中:

syntax_highlighter: prismjs
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: true
  preprocess: true
  line_number: true
  tab_replace: ''

添加 prismjs.css

在目录 hexo-theme-matery\source\libs\prism 下,添加:prism.css

分享:

prism.zip

@yanhuacuo
Copy link

勾选多种语言或全选,我上面分享的压缩包就是选了支持全部语言特性的

@sustcsugar
Copy link

你们会有代码折行的问题吗? 我博客的代码会自动换行, 主题里面yml的设置不管用。

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

3 participants