Revision: e2992be22a97
Author: Janne Härkönen <j...@reaktor.fi>
Date: Tue May 29 01:30:22 2012
Log: htmlformatters: handle bold text split in many lines
http://code.google.com/p/robotframework/source/detail?r=e2992be22a97
Modified:
/src/robot/utils/htmlformatters.py
/utest/utils/test_htmlutils.py
=======================================
--- /src/robot/utils/htmlformatters.py Tue May 29 01:06:59 2012
+++ /src/robot/utils/htmlformatters.py Tue May 29 01:30:22 2012
@@ -205,8 +205,8 @@
return line
def format(self, lines):
- # TODO: Join before or after format?
- return '<p>%s</p>' % ' '.join(self._format_line(l).strip() for l
in lines)
+ paragraph = ' '.join(l.strip() for l in lines).strip()
+ return '<p>%s</p>' % self._format_line(paragraph)
class TableFormatter(object):
=======================================
--- /utest/utils/test_htmlutils.py Tue May 29 01:06:59 2012
+++ /utest/utils/test_htmlutils.py Tue May 29 01:30:22 2012
@@ -176,7 +176,7 @@
inp = 'this is *bold*\nand *this*\nand *that*'
exp = 'this is <b>bold</b> and <b>this</b> and <b>that</b>'
assert_format(inp, exp, p=True)
- assert_format('this *works\ntoo!*', 'this *works too!*', p=True)
+ assert_format('this *works\ntoo!*', 'this <b>works too!</b>',
p=True)
def test_not_bolded_if_no_content(self):
assert_format('**', p=True)