changeset 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 148d30147890
children 9a019db21f3c
files sat_frontends/jp/cmd_blog.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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: