How to get SmartyPants to work?

I think I have turned SmartyPants on, but when I write two hyphens in the Panel and then view my page in the browser, two hyphens are displayed, rather than an en dash. Also curly quote marks are not working.

Here is my config.php file:

<?php

return [
    'debug'  => true
];

return [
  'smartypants' => true
];

Is this set up correctly? I’ve never used a config.php file before.
Does my website need to be live on the internet? I’m currently working on it locally, on a Mac, using MAMP.
Do I need to “refresh” Kirby for it to work?

You missed an important note in the docs: Configuration | Kirby CMS

Make sure to only use a single return statement in your config.php file (with all your options defined in that one return array).

1 Like

Fab! That worked. I can’t tell you how good it is to know I can use proper typography!

… actually is it possible, in the Panel, to write HTML characters, and for them to be displayed properly? I’m thinking of things like non-breaking spaces, ellipses, curly quote marks, dashes etc? So I’m in control and not relying on SmartyPants?

If you enter them via the keyboard, it should work, e.g. Alt+space on a Mac creates a non-breaking space.