Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. E.g. 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?

like image 966
Bosh Avatar asked May 25 '12 18:05

Bosh


1 Answers

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, i.e. 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.

like image 77
cboettig Avatar answered Oct 31 '22 21:10

cboettig