comparison browser_side/base_panels.py @ 405:41b8b96f2248

browser_side: display new lines in microblogs (convert '\n' to '<br/>')
author souliane <souliane@mailoo.org>
date Sat, 15 Mar 2014 00:33:04 +0100
parents c393e7dc9ae6
children 6a6551de4414
comparison
equal deleted inserted replaced
404:c393e7dc9ae6 405:41b8b96f2248
35 from pyjamas import DOM 35 from pyjamas import DOM
36 36
37 from datetime import datetime 37 from datetime import datetime
38 from time import time 38 from time import time
39 39
40 from html_tools import html_sanitize, html_strip, inlineRoot 40 from html_tools import html_sanitize, html_strip, inlineRoot, convertNewLinesToXHTML
41 41
42 from sat_frontends.tools.strings import addURLToText, addURLToImage 42 from sat_frontends.tools.strings import addURLToText, addURLToImage
43 from sat.core.i18n import _ 43 from sat.core.i18n import _
44 44
45 45
503 text = self._original_content['text'] 503 text = self._original_content['text']
504 if not self.options['no_xhtml']: 504 if not self.options['no_xhtml']:
505 text = addURLToImage(text) 505 text = addURLToImage(text)
506 if self.options['enhance_display']: 506 if self.options['enhance_display']:
507 text = addURLToText(text) 507 text = addURLToText(text)
508 self.display.setHTML(text) 508 self.display.setHTML(convertNewLinesToXHTML(text))
509 509
510 def setFocus(self, focus): 510 def setFocus(self, focus):
511 raise NotImplementedError 511 raise NotImplementedError
512 512
513 def onKeyDown(self, sender, keycode, modifiers): 513 def onKeyDown(self, sender, keycode, modifiers):