jp (blog/edit): fixed handling of XHTML content when it is not already wrapped in <div>…</div>

This commit is contained in:
Goffi 2019-03-25 07:06:48 +01:00
commit db06965385

View file

@ -570,6 +570,9 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
content, SYNTAX_XHTML, self.current_syntax, False, self.profile
)
if content and self.current_syntax == SYNTAX_XHTML:
content = content.strip()
if not content.startswith('<div>'):
content = u'<div>' + content + u'</div>'
try:
from lxml import etree
except ImportError: