Mercurial > libervia-backend
changeset 2878:a02ad4bc0a6d
plugin text syntaxes: activated useful markdown extensions:
- code can now be highlighted, fenced code block can be used.
- new lines are converted to hard breaks
- sane lists are used
- tables are available
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 25 Mar 2019 18:40:12 +0100 |
parents | f8427bf8c072 |
children | 5ba98fd6c9a4 |
files | sat/plugins/plugin_misc_text_syntaxes.py |
diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_text_syntaxes.py Mon Mar 25 18:40:11 2019 +0100 +++ b/sat/plugins/plugin_misc_text_syntaxes.py Mon Mar 25 18:40:12 2019 +0100 @@ -215,7 +215,20 @@ self.addSyntax( self.SYNTAX_MARKDOWN, - partial(markdown.markdown, extensions=[EscapeHTML()]), + partial(markdown.markdown, + extensions=[ + EscapeHTML(), + u'nl2br', + u'codehilite', + u'fenced_code', + u'sane_lists', + u'tables', + ], + extension_configs = { + u"codehilite": { + u"css_class": "highlight", + } + }), _html2text, [TextSyntaxes.OPT_DEFAULT], )