Mercurial > libervia-backend
comparison sat/plugins/plugin_misc_text_syntaxes.py @ 2869:148d30147890
plugin text syntaxes: fixed default syntax
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 25 Mar 2019 07:06:48 +0100 |
parents | be8405795e09 |
children | e1207b8ad97c |
comparison
equal
deleted
inserted
replaced
2868:5546613f5007 | 2869:148d30147890 |
---|---|
40 import re | 40 import re |
41 | 41 |
42 | 42 |
43 CATEGORY = D_("Composition") | 43 CATEGORY = D_("Composition") |
44 NAME = "Syntax" | 44 NAME = "Syntax" |
45 _SYNTAX_XHTML = "XHTML" | 45 _SYNTAX_XHTML = "xhtml" # must be lower case |
46 _SYNTAX_CURRENT = "@CURRENT@" | 46 _SYNTAX_CURRENT = "@CURRENT@" |
47 | 47 |
48 # TODO: check/adapt following list | 48 # TODO: check/adapt following list |
49 # list initialy based on feedparser list (http://pythonhosted.org/feedparser/html-sanitization.html) | 49 # list initialy based on feedparser list (http://pythonhosted.org/feedparser/html-sanitization.html) |
50 STYLES_WHITELIST = ( | 50 STYLES_WHITELIST = ( |
155 OPT_NO_THREAD = "NO_THREAD" | 155 OPT_NO_THREAD = "NO_THREAD" |
156 SYNTAX_XHTML = _SYNTAX_XHTML | 156 SYNTAX_XHTML = _SYNTAX_XHTML |
157 SYNTAX_MARKDOWN = "markdown" | 157 SYNTAX_MARKDOWN = "markdown" |
158 SYNTAX_TEXT = "text" | 158 SYNTAX_TEXT = "text" |
159 syntaxes = {} | 159 syntaxes = {} |
160 # default_syntax must be lower case | |
160 default_syntax = SYNTAX_XHTML | 161 default_syntax = SYNTAX_XHTML |
161 | 162 |
162 params = """ | 163 params = """ |
163 <params> | 164 <params> |
164 <individual> | 165 <individual> |
407 "to": to_xhtml_cb, | 408 "to": to_xhtml_cb, |
408 "from": from_xhtml_cb, | 409 "from": from_xhtml_cb, |
409 "flags": flags, | 410 "flags": flags, |
410 } | 411 } |
411 if TextSyntaxes.OPT_DEFAULT in flags: | 412 if TextSyntaxes.OPT_DEFAULT in flags: |
412 TextSyntaxes.default_syntaxe = key | 413 TextSyntaxes.default_syntax = key |
413 | 414 |
414 self._updateParamOptions() | 415 self._updateParamOptions() |
415 | 416 |
416 def getSyntax(self, name): | 417 def getSyntax(self, name): |
417 """get syntax key corresponding to a name | 418 """get syntax key corresponding to a name |