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).
This commit is contained in:
Goffi 2019-01-19 11:39:02 +01:00
commit 87871fabca

View file

@ -26,6 +26,7 @@ log = getLogger(__name__)
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 @@ class TextSyntaxes(object):
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