Em dash in Markdown not rendering as expected (with Smartypants parser)

In Markdown, we enter -- for an en-dash (–) and --- for an em-dash (—).

These hypens render as expected in this Kirby forum:

  • Here I enter three hyphens but you see an em-dash: —
  • Here I enter two hyphens but you see an en-dash: –

But on my instance of Kirby, the double hyphen -- is being parsed as an em-dash: —

So, for example, we get the following:

  • clause 1---clause 2---clause 3 rendering as “clause 1—-clause 2—-clause 3” instead of the expected “clause 1—clause 2—clause 3.”
  • 1950--1951 rendering as “1950—1951” instead of the expected “1950–1951.”

I can’t seem to get it to work as expected. Any one know what the cause could be?

In config.php, I have Smartypants on as follows:


  'smartypants' => true,

  'smartypants' => [
    'attr'                       => 1,
    'doublequote.open'           => '“',
    'doublequote.close'          => '”',
    'doublequote.low'            => '„',
    'singlequote.open'           => '‘',
    'singlequote.close'          => '’',
    'backtick.doublequote.open'  => '“',
    'backtick.doublequote.close' => '”',
    'backtick.singlequote.open'  => '‘',
    'backtick.singlequote.close' => '’',
    'emdash'                     => '—',
    'endash'                     => '–',
    'ellipsis'                   => '…',
    'space'                      => '(?: | | |&#0*160;|&#x0*[aA]0;)',
    'space.emdash'               => ' ',
    'space.endash'               => ' ',
    'space.colon'                => ' ',
    'space.semicolon'            => ' ',
    'space.marks'                => ' ',
    'space.frenchquote'          => ' ',
    'space.thousand'             => ' ',
    'space.unit'                 => ' ',
    'guillemet.leftpointing'     => '«',
    'guillemet.rightpointing'    => '»',
    'geresh'                     => '׳',
    'gershayim'                  => '״',
    'skip'                       => 'pre|code|kbd|script|style|math',
  ],