diff sat/plugins/plugin_misc_text_syntaxes.py @ 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 e1207b8ad97c
children ab2696e34d29
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],
             )