reverted patch 3770d13776e8
This commit is contained in:
parent
fab073076c
commit
fbb50a025d
2 changed files with 1 additions and 20 deletions
|
|
@ -176,11 +176,7 @@ class XEP_0277(object):
|
||||||
if data_elt.uri != NS_XHTML:
|
if data_elt.uri != NS_XHTML:
|
||||||
raise failure.Failure(exceptions.DataError(_('Content of type XHTML must declare its namespace!')))
|
raise failure.Failure(exceptions.DataError(_('Content of type XHTML must declare its namespace!')))
|
||||||
key = check_conflict(u'{}_xhtml'.format(elem.name))
|
key = check_conflict(u'{}_xhtml'.format(elem.name))
|
||||||
|
data = data_elt.toXml()
|
||||||
# This is needed to avoid a successive encapsulation with a new <div>...</div>
|
|
||||||
# each time the item is modified (encapsulation is done in self.data2entry).
|
|
||||||
data = xml_tools.decapsulateDomishContent(data_elt)
|
|
||||||
|
|
||||||
microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].clean_xhtml(data)
|
microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].clean_xhtml(data)
|
||||||
else:
|
else:
|
||||||
key = check_conflict(elem.name)
|
key = check_conflict(elem.name)
|
||||||
|
|
|
||||||
|
|
@ -1355,21 +1355,6 @@ class ElementParser(object):
|
||||||
return self.result.firstChildElement()
|
return self.result.firstChildElement()
|
||||||
|
|
||||||
|
|
||||||
def decapsulateDomishContent(elt):
|
|
||||||
"""Return the inner content of a domish.Element.
|
|
||||||
|
|
||||||
@param elt (domish.Element)
|
|
||||||
@return unicode
|
|
||||||
"""
|
|
||||||
result = ''
|
|
||||||
for child in elt.children:
|
|
||||||
try:
|
|
||||||
result += child.toXml() # child id a domish.Element
|
|
||||||
except AttributeError:
|
|
||||||
result += child # child is unicode
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: this method is duplicated from frontends.tools.xmlui.getText
|
# FIXME: this method is duplicated from frontends.tools.xmlui.getText
|
||||||
def getText(node):
|
def getText(node):
|
||||||
"""Get child text nodes of a domish.Element.
|
"""Get child text nodes of a domish.Element.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue