next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.34k stars 420 forks source link

prism 对于shell 语言未正常进行高亮显示 #309

Closed cddysq closed 2 years ago

cddysq commented 2 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

对于shell语言应该与在线调试网站保持一致

正常显示效果

Actual behavior

shell语言未能正常高亮

image

image

Steps to reproduce the behavior

  1. 启用prism
  2. 随意新建一篇文章,并添加shell代码块
  3. 启动Hexo进行访问文章

Environment Information

Node.js and NPM Information

v14.17.0
7.19.0

Package dependencies Information

hexo-site@0.0.0 E:\CodeHaotian.github.io
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-category@1.0.0
+-- hexo-generator-index@2.0.0
+-- hexo-generator-tag@1.0.0
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-marked@4.0.0
+-- hexo-renderer-stylus@2.0.1
+-- hexo-server@2.0.0
+-- hexo-theme-landscape@0.0.3
`-- hexo@5.4.0

Hexo Configuration

详细可以看我上面贴出来的仓库

NexT Configuration

详细可以看我上面贴出来的仓库

Other Information

welcome[bot] commented 2 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

ljcbaby commented 2 years ago

image Failed to reproduce, you can try the latest version first.

cddysq commented 2 years ago

图像 重现失败,您可以先尝试最新版本。

我已经尝试next主分支最新代码,依然未高亮显示,不知道是什么情况导致该问题的出现,不知道您是否愿意帮忙排查该问题,万分感谢 !

image

源代码已全部同步至仓库:https://github.com/CodeHaotian/CodeHaotian.github.io

ljcbaby commented 2 years ago

你需要执行npm i prismjs安装

cddysq commented 2 years ago

你需要执行npm i prismjs安装

我已经安装了该插件,奇怪的现象是只有shell标注的代码块未能高亮显示,其他语言都能正常高亮,网页效果如下图:

image

ljcbaby commented 2 years ago

https://github.com/CodeHaotian/CodeHaotian.github.io/blob/HexoNexT/package.json 未见安装

cddysq commented 2 years ago

https://github.com/CodeHaotian/CodeHaotian.github.io/blob/HexoNexT/package.json 未见安装

抱歉,按照你的提示安装后,未及时更新代码至仓库,现已更新,网页依然只有shell标记代码块未高亮

image

cddysq commented 2 years ago

https://github.com/CodeHaotian/CodeHaotian.github.io/blob/HexoNexT/package.json 未见安装

网页效果:

image

ljcbaby commented 2 years ago

image 老哥你类型写错了

PS:建议把package-lock.json加到.gitignore

ljcbaby commented 2 years ago

用bash是正常的

cddysq commented 2 years ago

用bash是正常的

真的非常感谢老哥你的帮助!!!我以前都是用的shell,没想到是bash,修改语言类型后已经显示正常。

ljcbaby commented 2 years ago

你需要执行npm i prismjs安装

un掉试试,好像Hexo5自带了

cddysq commented 2 years ago

你需要执行npm i prismjs安装

un掉试试,好像Hexo5自带了

已试验,卸载后一切正常,Hexo 5 不需要单独安装,自带了

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. It is possible issue was solved or at least outdated. Feel free to open new for related bugs.