comparison 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
comparison
equal deleted inserted replaced
2869:148d30147890 2870:2f39682f6d40
568 if content and self.current_syntax != SYNTAX_XHTML: 568 if content and self.current_syntax != SYNTAX_XHTML:
569 content = self.host.bridge.syntaxConvert( 569 content = self.host.bridge.syntaxConvert(
570 content, SYNTAX_XHTML, self.current_syntax, False, self.profile 570 content, SYNTAX_XHTML, self.current_syntax, False, self.profile
571 ) 571 )
572 if content and self.current_syntax == SYNTAX_XHTML: 572 if content and self.current_syntax == SYNTAX_XHTML:
573 content = content.strip()
574 if not content.startswith('<div>'):
575 content = u'<div>' + content + u'</div>'
573 try: 576 try:
574 from lxml import etree 577 from lxml import etree
575 except ImportError: 578 except ImportError:
576 self.disp(_(u"You need lxml to edit pretty XHTML")) 579 self.disp(_(u"You need lxml to edit pretty XHTML"))
577 else: 580 else: