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

代码高亮有问题,背景色影响了主题 #390

Closed
twitf opened this issue Sep 19, 2023 · 14 comments
Closed

代码高亮有问题,背景色影响了主题 #390

twitf opened this issue Sep 19, 2023 · 14 comments
Labels
triage Issues waiting to be inspected

Comments

@twitf
Copy link

twitf commented Sep 19, 2023

我标注出来了你可以看下

Snipaste_2023-09-19_15-03-13

@bennyxguo bennyxguo added the bug Something isn't working label Sep 19, 2023
@bennyxguo
Copy link
Member

对那些padding 确实没有按照背景颜色来。下一个版本修复。

@bennyxguo bennyxguo added this to the v2.5.3 milestone Sep 19, 2023
@bennyxguo bennyxguo moved this from Backlog to Developing in Hexo Aurora 2.x Roadmap Sep 28, 2023
@bennyxguo
Copy link
Member

@twitf 这个问题是你的配置问题。我配置了一下没有你这个问题。使用下面这个配置:

#! ---------------------------------------------------------------
#! Highlighter Shiki
#! ---------------------------------------------------------------
shiki:
  enable: true
  theme: "material-theme-palenight" #主题名

@bennyxguo bennyxguo added help wanted Extra attention is needed and removed bug Something isn't working labels Sep 28, 2023
@bennyxguo bennyxguo removed this from the v2.5.3 milestone Sep 28, 2023
@bennyxguo bennyxguo moved this from Developing to Blocked in Hexo Aurora 2.x Roadmap Sep 28, 2023
@twitf
Copy link
Author

twitf commented Oct 13, 2023

我觉得你那个不是最新版本,我现在时这样处理的:/**background-color:var(--bg-accent-05);*/

.post-html p code,.post-html li code {
    margin: 0;
    font-size: .85em;
    overflow-wrap: break-word;
    /**background-color:var(--bg-accent-05);*/
    word-wrap: break-word;
    padding: .1rem .3rem;
    border-radius: .3rem;
    color: var(--text-accent)!important
}

@bennyxguo
Copy link
Member

我用的就是版本 2.5.3 哦

@myronzhangweb3
Copy link

我也遇到这个问题了 现在最新的版本是2.5.2

配置了:
#! ---------------------------------------------------------------
#! Highlighter Shiki
#! ---------------------------------------------------------------
shiki:
enable: true
theme: "material-theme-palenight" #主题名
也不可以

@bennyxguo
Copy link
Member

我也遇到这个问题了 现在最新的版本是2.5.2

配置了: #! --------------------------------------------------------------- #! Highlighter Shiki #! --------------------------------------------------------------- shiki: enable: true theme: "material-theme-palenight" #主题名 也不可以

你可以截图看看你的配置吗?你的配置的格式感觉不对。shiki 后面的两个参数需要有缩紧两个空格才行。

#! ---------------------------------------------------------------
#! Highlighter Shiki
#! ---------------------------------------------------------------
shiki:
  enable: true
  theme: "material-theme-palenight" #主题名

@myronzhangweb3
Copy link

image
image

@myronzhangweb3
Copy link

我也遇到这个问题了 现在最新的版本是2.5.2
配置了: #! --------------------------------------------------------------- #! Highlighter Shiki #! --------------------------------------------------------------- shiki: enable: true theme: "material-theme-palenight" #主题名 也不可以

你可以截图看看你的配置吗?你的配置的格式感觉不对。shiki 后面的两个参数需要有缩紧两个空格才行。

#! ---------------------------------------------------------------
#! Highlighter Shiki
#! ---------------------------------------------------------------
shiki:
  enable: true
  theme: "material-theme-palenight" #主题名

截图在上面👆

@bennyxguo bennyxguo added triage Issues waiting to be inspected and removed help wanted Extra attention is needed labels Oct 31, 2023
@bennyxguo bennyxguo moved this from Blocked to Backlog in Hexo Aurora 2.x Roadmap Oct 31, 2023
@bennyxguo
Copy link
Member

我在本地也测试了,可以显示,没有问题哦。
image

@myronzhangweb3
Copy link

不清楚为什么我这个不行😂

https://blog.web3idea.xyz/post/cryptography%2FECDH

@bennyxguo
Copy link
Member

bennyxguo commented Nov 1, 2023

如果你们的代码高亮出现了问题,很有可能你们在 hexo 下之前用过了其它的主题安装着其他主题的 hexo 插件。或者你在用一些其他的插件。但是 Aurora 对有一些插件是无法互相兼容的。如果你测试出是哪个插件。请另外提一个 issue,我后面看看能否兼容。

如果你不知道哪个插件不兼容,可以直接用我下面的 dependenices 来覆盖你 package.json 里面的 dependenices:

...

"dependencies": {
  "hexo": "^6.3.0",
  "hexo-filter-mathjax": "^0.9.0",
  "hexo-generator-archive": "^2.0.0",
  "hexo-generator-category": "^2.0.0",
  "hexo-generator-index": "^3.0.0",
  "hexo-generator-tag": "^2.0.0",
  "hexo-plugin-aurora": "^1.2.0",
  "hexo-renderer-ejs": "^2.0.0",
  "hexo-renderer-marked": "^6.1.0",
  "hexo-renderer-stylus": "^3.0.0",
  "hexo-server": "^3.0.0",
  "hexo-theme-aurora": "^2.0.0"
}

...

@twitf
Copy link
Author

twitf commented Nov 15, 2023

当我升级主题至最新的版本2.5.3,代码高亮问题已经ok,谢谢

@twitf twitf closed this as completed Nov 15, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Ready to deploy in Hexo Aurora 2.x Roadmap Nov 15, 2023
@myronzhangweb3
Copy link

能否支持一下pandoc渲染?感谢🙏

@twitf
Copy link
Author

twitf commented Nov 24, 2023

image

我又一次复现了这个问题 ,这应该是缩进不规范 然后渲染出问题了,不清楚是不是主题的原因,这个100%必先。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues waiting to be inspected
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants