diff 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
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_text_syntaxes.py	Sat Jan 19 11:39:02 2019 +0100
+++ b/sat/plugins/plugin_misc_text_syntaxes.py	Sat Jan 19 11:39:02 2019 +0100
@@ -26,6 +26,7 @@
 from twisted.internet import defer
 from twisted.internet.threads import deferToThread
 from sat.core import exceptions
+from sat.tools import xml_tools
 
 try:
     from lxml import html
@@ -205,6 +206,9 @@
         host.bridge.addMethod(
             "syntaxGet", ".plugin", in_sign="s", out_sign="s", method=self.getSyntax
         )
+        if xml_tools.cleanXHTML is None:
+            log.debug(u"Installing cleaning method")
+            xml_tools.cleanXHTML = self.cleanXHTML
 
     def _updateParamOptions(self):
         data_synt = TextSyntaxes.syntaxes