plugin XEP-0277: raise a failure if XHTML content is not wrapped in a <div/>
This commit is contained in:
parent
9cc2a923fa
commit
2a015e3bec
1 changed files with 2 additions and 0 deletions
|
|
@ -173,6 +173,8 @@ class XEP_0277(object):
|
|||
type_ = elem.getAttribute('type')
|
||||
if type_ == 'xhtml':
|
||||
data_elt = elem.firstChildElement()
|
||||
if data_elt is None:
|
||||
raise failure.Failure(exceptions.DataError(u"XHML content not wrapped in a <div/> element, this is not standard !"))
|
||||
if data_elt.uri != NS_XHTML:
|
||||
raise failure.Failure(exceptions.DataError(_('Content of type XHTML must declare its namespace!')))
|
||||
key = check_conflict(u'{}_xhtml'.format(elem.name))
|
||||
|
|
|
|||
Loading…
Reference in a new issue