Browse Source

markdown: allow to specify output format

By default, Markdown is building XHTML. If you do an HTML5 website, it
can therefore generate invalid markups (for example <th /> is not
valid in HTML5). Markdown can be configured with "output_format". This
patch adds this configuration switch to Hyde:

```
markdown:
  extensions:
    - codehilite
    - extra
    - toc
  output_format: html
```
main
Vincent Bernat 13 years ago
parent
commit
09ac4a283e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      hyde/ext/templates/jinja.py

+ 2
- 0
hyde/ext/templates/jinja.py View File

@@ -106,6 +106,8 @@ def markdown(env, value):
d['extension_configs'] = getattr(env.config.markdown,
'extension_configs',
Expando({})).to_dict()
if hasattr(env.config.markdown, 'output_format'):
d['output_format'] = env.config.markdown.output_format
marked = md.Markdown(**d)

return marked.convert(output)


Loading…
Cancel
Save