diff sat_frontends/jp/cmd_blog.py @ 2870:2f39682f6d40

jp (blog/edit): fixed handling of XHTML content when it is not already wrapped in <div>…</div>
author Goffi <goffi@goffi.org>
date Mon, 25 Mar 2019 07:06:48 +0100
parents 51c53fc4fc4a
children 84f82d014d06
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_blog.py	Mon Mar 25 07:06:48 2019 +0100
+++ b/sat_frontends/jp/cmd_blog.py	Mon Mar 25 07:06:48 2019 +0100
@@ -570,6 +570,9 @@
                 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: