comparison sat/plugins/plugin_misc_text_syntaxes.py @ 2782:b17e6fa1e607

core (XMLUI): new XHTMLBox widget: XHTMLBox is a textbox specialised in XHTML, i.e. it renders the XHTML when in read_only, and it allows to edit it. The XHTML is cleaned by default, the cleaning is done by Text Syntaxes plugin (actually there is a cleaning method which can be set by any plugin, but Text Syntaxes is the one which does it).
author Goffi <goffi@goffi.org>
date Sat, 19 Jan 2019 11:39:02 +0100
parents 816be0a23877
children be8405795e09
comparison
equal deleted inserted replaced
2781:816be0a23877 2782:b17e6fa1e607
24 log = getLogger(__name__) 24 log = getLogger(__name__)
25 25
26 from twisted.internet import defer 26 from twisted.internet import defer
27 from twisted.internet.threads import deferToThread 27 from twisted.internet.threads import deferToThread
28 from sat.core import exceptions 28 from sat.core import exceptions
29 from sat.tools import xml_tools
29 30
30 try: 31 try:
31 from lxml import html 32 from lxml import html
32 from lxml.html import clean 33 from lxml.html import clean
33 except ImportError: 34 except ImportError:
203 method=self.convert, 204 method=self.convert,
204 ) 205 )
205 host.bridge.addMethod( 206 host.bridge.addMethod(
206 "syntaxGet", ".plugin", in_sign="s", out_sign="s", method=self.getSyntax 207 "syntaxGet", ".plugin", in_sign="s", out_sign="s", method=self.getSyntax
207 ) 208 )
209 if xml_tools.cleanXHTML is None:
210 log.debug(u"Installing cleaning method")
211 xml_tools.cleanXHTML = self.cleanXHTML
208 212
209 def _updateParamOptions(self): 213 def _updateParamOptions(self):
210 data_synt = TextSyntaxes.syntaxes 214 data_synt = TextSyntaxes.syntaxes
211 default_synt = TextSyntaxes.default_syntax 215 default_synt = TextSyntaxes.default_syntax
212 syntaxes = [] 216 syntaxes = []