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_theme后代码还是无法高亮 #989

Closed
gydmercy opened this issue Jul 15, 2016 · 18 comments
Closed

设置highlight_theme后代码还是无法高亮 #989

gydmercy opened this issue Jul 15, 2016 · 18 comments

Comments

@gydmercy
Copy link

我在 next 配置文件中更改 highlight_theme 的值比如 normal 或者 night。代码部分的底色确实会改变,但是代码本身没有一点高亮,这是为什么呢?以前是好的,我后来迁移了电脑,更新了 next 主题后,就这样了。当前使用版本5.0.1

@shaohui10086
Copy link

应该是你没设置代码的语言
simple:java
在```后面跟上语言

@gydmercy
Copy link
Author

以前不设置代码语言也可以高亮

在 2016年7月24日,14:13,邵辉Vista notifications@github.com 写道:

应该是你没设置代码的语言
simple:java
在```后面跟上语言


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@AirmaZ
Copy link

AirmaZ commented Sep 20, 2016

同问,我现在也是这个问题,lz解决了吗

@gydmercy
Copy link
Author

算是找到个折中的办法吧

在markdown中,代码块用 ''' '''包裹就可以高亮,直接行首加 tab 来包裹代码块就无法高亮

以前两者都可以高亮的

在 2016年9月20日,13:13,HongWei notifications@github.com 写道:

同问,我现在也是这个问题,lz解决了吗


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@AirmaZ
Copy link

AirmaZ commented Sep 20, 2016

@gydmercy
多谢,next的代码高亮真实迷啊

@iissnan
Copy link
Owner

iissnan commented Oct 19, 2016

@gydmercy 可能是你升级了 Hexo。Hexo 新版本里代码高亮默认是不做自动检测,从而导致失效。解决方法是修改你的站点配置文件,将 hilight.auto_detect 设置为 true

highlight:
  enable: true
  auto_detect: true
  line_number: true
  tab_replace:

@gydmercy
Copy link
Author

确实是之前是好的,我换了电脑装了最新版 hexo 后 代码就不高亮了。
不过我看了下站点配置文件,你所说的那个地方本来就是 true 。但还是没什么作用。

2016年10月19日星期三,Vi notifications@github.com 写道:

@gydmercy https://github.com/gydmercy 可能是你升级了 Hexo。Hexo
新版本里代码高亮默认是不做自动检测,从而导致失效。解决方法是修改你的站点配置文件,将 hilight.auto_detect 设置为 true:

highlight:
enable: true
auto_detect: true
line_number: true
tab_replace:


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#989 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF7WnyHCJ7ZgOq0CntpN_vrCeNbXm7LHks5q1acRgaJpZM4JM_vv
.

@otherfish
Copy link

确实是,我的主题版本是:

Theme version:version: 0.4.5.1

无论是在代码段加上四个空格还是用 ```bash 语法都是显示的黑底白字

snipaste20161028_124055

例如:
snipaste20161028_124241

@lixiansky
Copy link

lixiansky commented Nov 11, 2016

@gydmercy 这个问题是 设置 Social Links Icon 导致的!!!你把

social:
  GitHub: https://github.com/xxx
  Twitter: https://twitter.com/xxxx
  Weibo: http://weibo.com/xxxxx

这些信息配置放到你的站点配置信息里,不要放在主题配置信息里,就可以了!!!
**PS:**这个问题还导致“打赏”功能的样式,全部丢失!!!!我查看了一下main.css少几百行代码,具体的源码没有看!!

@bigggge
Copy link

bigggge commented Mar 7, 2017

同,四个空格的代码块不能高亮,怎么解决

@seanhuang514
Copy link

seanhuang514 commented Mar 21, 2017

@iissnan 我也有一樣的問題,highlight有設true了, ```ruby 後面也加上語言了,但還是如下面的圖一樣沒有highlight,請問有人有解嗎?

highlight:
  enable: true
  auto_detect: true
  line_number: true
  tab_replace:

2017-03-21 10 43 36

@chengdwei
Copy link

chengdwei commented Apr 6, 2017

我也同样遇到这样的问题,使用
hexo clean

然后重新生成,再启动就好了。
image

@tisfeng
Copy link

tisfeng commented Jul 19, 2017

同问,代码不高亮。。。在markdown里写好代码高亮显示,到了hexo博客里就是灰色一片

@tisfeng
Copy link

tisfeng commented Jul 19, 2017

突然又好了。。。擦
image

@tisfeng
Copy link

tisfeng commented Jul 19, 2017

不过这里为什么会把代码类型的名字「objective-c」给显示出来呢
原版的markdown没有啊
而且只显示开始的「」并没有结尾的「

@ivan-nginx
Copy link
Collaborator

ivan-nginx commented Jul 19, 2017

@wxf721 what the point? Issue is solved?
@gydmercy if solved, close it please.

Anyway, this configuration is not for theme Next, this is for global Hexo. So, i don't understand why peoples write issue in Next theme issues when real trouble in main Hexo engine.

@tisfeng
Copy link

tisfeng commented Jul 19, 2017

并没有,,这问题很奇怪,这会儿又不行了。Java和C语言的高亮可以显示,CSS和OC却不能,只测试了这几个,有问题。。我对这个不了解
image

wx20170720-074931 2x

@JACKROMER
Copy link

highlight:
enable: true
line_number: true
auto_detect: true<<<设置这个后,先hexo clean,再重新启动server
tab_replace:

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

No branches or pull requests