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

代码高亮autoDetect 沒有传到util.highlight #1723

Closed
huanz opened this issue Jan 24, 2016 · 7 comments
Closed

代码高亮autoDetect 沒有传到util.highlight #1723

huanz opened this issue Jan 24, 2016 · 7 comments
Labels
bug Something isn't working highlight

Comments

@huanz
Copy link

huanz commented Jan 24, 2016

升级3.1.1之后,即使config.yml里面的highlight.auto_detect设置为true,依然无法自动检测语言类型。看了下代码是hexo-util里面的highlight.js大约75行位置的autoDetect被默认设置成了false,建议处理下这个问题,希望可以通过config来配置是否开启自动检测。

@huanz huanz changed the title 代码高亮问题autoDetect autoDetect代码高亮问题 Jan 24, 2016
@huanz
Copy link
Author

huanz commented Jan 25, 2016

还有config.yml里面的highlight.enable设置为false,看起来也不会起作用。

@ghost
Copy link

ghost commented Jan 30, 2016

No bug was found in source code.

@huanz
Copy link
Author

huanz commented Jan 30, 2016

@nyaatyan highlight的参数options是在调用的时候直接传的一个对象,而并没有继承config里面的配置,可以看下hexo-renderer-markedlib/renderer.js大概60行的位置

@ghost
Copy link

ghost commented Jan 30, 2016

So you mean hexo-renderer-marked doesn't respect Hexo config, right?
Then you'd better open an issue in hexo-renderer-marked.

@leesei leesei added bug Something isn't working need-verify labels Feb 19, 2016
@leesei leesei changed the title autoDetect代码高亮问题 代码高亮autoDetect 沒有传到util.highlight Feb 19, 2016
@leesei
Copy link
Member

leesei commented Feb 19, 2016

不過auto detect 算法會拖慢處理, 甚至當掉generate
不建議使用

@Xuanwo
Copy link
Contributor

Xuanwo commented Jul 2, 2016

@leesei 现在最新的代码高亮已经失效了。

@stevenjoezhang
Copy link
Member

stevenjoezhang commented Mar 6, 2020

options of highlight does respect Hexo config: 5b172aa
You may need to run hexo clean after editing _config.yml

See also #1786

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

No branches or pull requests

4 participants