简体   繁体   中英

Underscore issues: Jekyll + redcarpet == Github flavored markdown?

I'm buliding a site with github pages and do not want underscores within words to italicize portions of those words. Eg function_name_here should not render with name italicized. I understand github flavored markdown is supposed to be smart like this; but I'm still seeing italics in my rendered page.

I have set in my _config.yml

markdown: redcarpet

... anything else I need to do to get Github flavored markdown behavior?

The version of Jekyll available on github's gh-pages does not run the latest version of redcarpet (redcarpet2) which supports these features. There's a plugin to provide the latest version of redcarpet to Jekyll , in which you can then configure to the behaviour you want, ie then add this to your _config.yml

markdown: redcarpet2
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables",     "with_toc_data"]

Yes, I agree it seems crazy that github doesn't run the same markdown parser on gh-pages as it uses for its github-flavored-markdown everywhere else on the site.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM