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

Provide an option to disable code highlighting auto-detect lacking lang #1224

Closed
hcoona opened this issue Apr 23, 2015 · 7 comments
Closed
Labels
feature-request question Needs help in usage

Comments

@hcoona
Copy link
Contributor

hcoona commented Apr 23, 2015

Hi Sir,

I want an option to disable auto code highlighting, because I want the default behavior is not to highlight my quote blocks in my migrated articles. They are previously written in markdown language in Jekyll. The default behavior changed. I have to modify each blocks to add 'lang=plain' to avoid wrong highlighting. This block me from switching to the great hexo.

Thanks!

@tommy351
Copy link
Member

Edit _config.yml.

highlight:
  enable: false

http://hexo.io/docs/configuration.html#Writing

@tommy351 tommy351 added the question Needs help in usage label Apr 23, 2015
@hcoona
Copy link
Contributor Author

hcoona commented Apr 24, 2015

Hi @tommy351 ,

Thanks for your answer. However I think it means not to highlight any blocks, that's not what I want.

I want to control the default behavior if there is no lang assigned to a code block. Currently hexo would make it auto-detect. I want to make it do not auto-detect and just make it plain.

Thanks.

@tommy351
Copy link
Member

I see. Hexo doesn't provide this option so far.

@hcoona hcoona changed the title Provide an option to disable auto code highlighting Provide an option to disable code highlighting auto-detect lacking lang Apr 24, 2015
@hcoona
Copy link
Contributor Author

hcoona commented Apr 24, 2015

I modified the title to make it clearer.

@tommy351
Copy link
Member

Would be great to have this feature. Highlight.js is slow in auto detection.

@hcoona
Copy link
Contributor Author

hcoona commented Apr 24, 2015

Please consider to make it with high priority :)
It's not hard to add this option. Thanks!

@iissnan
Copy link

iissnan commented May 28, 2015

Seems users need to add auto_detect: true to _config.yml manually when upgrading to 3.1.1, or else this option will be off by default.

@leesei leesei closed this as completed Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request question Needs help in usage
Projects
None yet
Development

No branches or pull requests

4 participants