Underscore issues: Jekyll + redcarpet == Github flavored markdown?
Asked Answered
P

1

18

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?

Postrider answered 25/5, 2012 at 18:23 Comment(0)
A
20

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.

Alabama answered 28/5, 2012 at 21:45 Comment(2)
As of Jekyll 0.12.0, redcarpet2 is supported by Jekyll without the need for a plugin, so the approach shown in the original question should now work without additional modification.Alabama
According to the GitHub pages Jeklly docs they are now using redcarpet 2.2.2.Tuneberg

© 2022 - 2024 — McMap. All rights reserved.