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

highlight.js代码高亮 行号不显示 #877

Closed
mstg-blog opened this issue Apr 18, 2024 · 4 comments
Closed

highlight.js代码高亮 行号不显示 #877

mstg-blog opened this issue Apr 18, 2024 · 4 comments
Labels
bug Something isn't working Stale

Comments

@mstg-blog
Copy link

注意,在报告之前请先确认:你已经清除过浏览器 / CDN 缓存;你没有修改过相关源代码;你已经在本仓库的issue中搜索确认了没有其他人提过了类似的问题。
在确定这的确是原项目中的问题之后,请删除这段文本,并继续报告。

问题出处:

这个问题出在程序的哪一个具体功能?
highlight.js代码高亮模块

实际行为描述:

触发问题后造成了什么效果及影响?
近期几篇博客中的代码发现绝大部分没有行号显示,例如https://blog.mstg.top/archives/1113 全部代码块的行号都不显示

image
但前面几篇博客显示大多数是有行号的(也有一些不显示行号),例如https://blog.mstg.top/archives/1069
image

预期的行为:

这个功能应该有怎样的效果和影响?

应该行号显示正常

复现步骤:

怎样才能再次触发这个问题?
以我目前的工作流来说,使用typora(版本1.8.10)编写md文本,随后ctrl+a全选后复制为Markdown,使用wp区块编辑器,直接粘贴,发布后即出现该问题.
尝试typora中重新创建代码块,重新复制更新到网站上,仍出现改问题(但使用wp编辑器的代码模式与前期显示行号的文章对比,格式几乎一致)
出现问题文章
image
image

可以显示行号的旧帖子
image

(当前网站wp版本6.5.2,主题版本2.6.3.1)

配置与环境:

  • 问题页面:无法显示行号页面 https://blog.mstg.top/archives/1113 ,可以显示行号页面 https://blog.mstg.top/archives/1069
  • PHP 版本:8.1
  • 数据库类型 / 版本:MySQL 5.7.44
  • WordPress 版本:6.5.2
  • 主题版本:(Release 标注的版本号)2.6.3.1
  • 使用的插件:(所有使用中的的插件,以便判断兼容性问题)
    All-in-One WP Migration
    Basic User Avatars
    Post SMTP
    Redis Object Cache
    Wordfence安全
    WP Extended Search
    WP Statistics
    超级缓存
  • 浏览器:(浏览器名称及版本号) edge 123.0.2420.97

截图(若有)

提供一个此问题触发的截图或报错信息。若没有,则留空。

补充信息:

提供尽可能多的相关信息。

@mstg-blog mstg-blog added the bug Something isn't working label Apr 18, 2024
Copy link

@mstg-blog,感谢你给 sakurairo 提出了 issue。ヾ(≧▽≦*)o
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@mstg-blog
Copy link
Author

排查到问题了,最新wordpress6.5.2版本的区块编辑器,会将代码块的行间隔符转为span ,刚尝试回退到6.4.4重新复制文章后更新,行号显示正确,重新升级到6.5.2,行号显示仍正确,不知道是否为wordpress6.5.2版本区块编辑器的bug还是不匹配原因

Copy link

这个 Issue 已经 30 天没有任何活动了,将被标记为过时 stale。删除 stale 标签或评论,否则将在 7 天内关闭。

@github-actions github-actions bot added the Stale label May 19, 2024
Copy link

此 Issue 由于被标记为过时 stale 且超过 7 天没有活动,已自动关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant