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

语言类型相同的代码块只有第一个被高亮 #1718

Closed
sumy7 opened this issue Jan 18, 2016 · 4 comments
Closed

语言类型相同的代码块只有第一个被高亮 #1718

sumy7 opened this issue Jan 18, 2016 · 4 comments

Comments

@sumy7
Copy link

sumy7 commented Jan 18, 2016

感觉和 #1710 是相同的问题。标记为相同语言的代码块,只有第一个能被高亮。
如:

```java
System.out.println("Hello World");
```

巴拉巴拉小魔仙

```java
// java codeblock 2
```

第一个代码块render出来html的class为highlight java,第二个class是highlight
包括使用{% codeblock lang:java %} 和两种情况混合使用。
请问这是什么原因?

@liuzc
Copy link

liuzc commented Jan 22, 2016

你可以尝试使用Google Prettify: https://liuzhichao.com/2016/hexo-use-prettify-to-highlight-code.html

@netcan
Copy link

netcan commented Jan 24, 2016

好像出在特定语句就会不高亮。。
@liuzc 现在一关掉代码高亮选项就崩溃了。。

@leesei
Copy link
Member

leesei commented Apr 13, 2016

關掉代码高亮选项有問題可以參考 #1811

@sumy7
Copy link
Author

sumy7 commented Apr 13, 2016

按照 #1710 中提到的方法,更新了highlight.js之后,又将所有未高亮的代码检查了一遍。发现未高亮的代码中存在不能识别的字符,导致highlight.js无法识别语言,比如多种语言混合使用,一些语法错误等。

至此高亮问题基本解决了。也不能算是一个bug了:joy:。。。

@sumy7 sumy7 closed this as completed Apr 13, 2016
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

4 participants