title: SmartyPants Extension prev_title: Sane Lists Extension prev_url: sane_lists.html next_title: Table of Contents Extension next_url: toc.html SmartyPants =========== Summary ------- The SmartyPants extension converts ASCII dashes, quotes and ellipses to their HTML entity equivalents. ASCII symbol | Replacements | HTML Entities ------------ | --------------- | ------------------- `'` | ‘ ’ | `‘` `’` `"` | “ ” | `“` `”` `<< >>` | « » | `«` `»` `...` | … | `…` `--` | – | `–` `---` | — | `—` Using the options `smart_lsquo` etc. you can reconfigure the replacements for `'` and `"`. Use e.g. the following config to get correct quotes for the German language: extensionConfigs = { 'smarty': [('smart_lsquo', '‚'), # sb is not a typo! ('smart_rsquo', '‘'), ('smart_ldquo', '„'), ('smart_rdquo', '“')] } !!! note This extension reimplements the Python [SmartyPants] library by intregated it into the markdown parser. While this does not provide any additional features, it does offer a few advantages. Notably, it will not try to work on highlighted code blocks (using the [CodeHilite] Extension) like the third party library has been known to do. [SmartyPants]: http://pythonhosted.org/smartypants/ [CodeHilite]: code_hilite.html Usage ----- See [Extensions](index.html) for general extension usage, specify `smarty` as the name of the extension. See the [Library Reference](../reference.html#extensions) for information about configuring extensions. The following options are provided to configure the output: Option | Default value | Description ------ | ------------- | ----------- `smart_dashes` | enabled | whether to convert dashes `smart_quotes` | enabled | whether to convert straight quotes `smart_angled_quotes` | disabled | whether to convert angled quotes `smart_ellipses` | enabled | whether to convert ellipses `smart_lsquo` | ‘ | Replacement text for single left quote `smart_rsquo` | ’ | Replacement text for single right quote `smart_ldquo` | “ | Replacement text for double left quote `smart_rdquo` | ” | Replacement text for double right quote Further reading --------------- SmartyPants extension is based on the original SmartyPants implementation by John Gruber. Please read it's [documentation][1] for details. [1]: http://daringfireball.net/projects/smartypants/