Use two hyphens to type an em-dash

With SmartyPants turned on, Jekyll converts two hyphens into an en-dash and three hyphens into an em-dash. Is there any way I could configure Jekyll to convert two hyphens into an em-dash instead? The thing is: I don’t use en-dash at all, and in manuscript format two hyphens indicate an em-dash.

Kramdown, not Jekyll handles converting -- and --- to en and em-dashes. Digging into Kramdown’s docs they have a typographic_symbols config that in theory you could use to make en-dashes output as em. I haven’t done such a thing, but it seems possible.

You’d need to set the Kramdown options in your Jekyll _config.yml file. They document that here:

And then related Kramdown docs are here (bottom of the page):
https://kramdown.gettalong.org/options.html

1 Like

Thanks, @mmistakes. Your pointers helped me figure out a workaround. For anyone else trying to do something similar, I’m leaving my solution here.

I added an option for kramdown in _config.yml that told the engine to use an em-dash for two hyphens. Follow the links @mmistakes provided and everything will make sense.

kramdown:
  typographic_symbols:
      ndash: —