# HG changeset patch # User souliane # Date 1448559061 -3600 # Node ID 102050e489faf4005f4ec51b4e593fb20bc9b66c # Parent e67d8c13ba224e16b96ec4788586388a4ebe4b50 browser_side (blog): fixes syntax conversion diff -r e67d8c13ba22 -r 102050e489fa src/browser/sat_browser/blog.py --- a/src/browser/sat_browser/blog.py Thu Nov 26 13:51:06 2015 +0100 +++ b/src/browser/sat_browser/blog.py Thu Nov 26 18:31:01 2015 +0100 @@ -243,7 +243,7 @@ # TODO: if the user change his parameters after the message edition started, # the message syntax could be different then the current syntax: pass the # message syntax in mb_data for the frontend to use it instead of current syntax. - self.item.content_rich = content['text'] + self.item.content_rich = content['text'] # XXX: this also works if the syntax is XHTML self.item.title = content['title'] self.item.tags = list(common.dict2iter('tag', content)) else: @@ -309,14 +309,14 @@ if self.mode in ENTRY_RICH and not text: text = ' ' # something different than empty string is needed to initialize the rich text editor self.item.content = text + if self.mode in ENTRY_RICH: + self.item.content_rich = text # XXX: this also works if the syntax is XHTML + self.bubble.setDisplayContent() # needed in case the edition is aborted, to not end with an empty bubble + else: + self.item.content_xhtml = '' self.bubble.removeFromParent() self._setBubble() self.bubble.setOriginalContent(original_content) - if self.mode in ENTRY_RICH: - self.item.content_xhtml = text - self.bubble.setDisplayContent() # needed in case the edition is aborted, to not end with an empty bubble - else: - self.item.content_xhtml = '' def toggleContentSyntax(self): """Toggle the editor between raw and rich text"""