summaryrefslogtreecommitdiff
path: root/src/xhtml.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-03-29 21:07:53 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-03-29 21:07:53 +0200
commit51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b (patch)
tree7dcf3a431daaeb200dba00ea6d33c8068d2b0202 /src/xhtml.py
parent42f4d555125ef3616e630b3e502285c496d382fc (diff)
downloadpoezio-51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b.tar.gz
poezio-51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b.tar.bz2
poezio-51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b.tar.xz
poezio-51cebe7bdc24fbeecd6b4ed0bd87760b84a2ef3b.zip
Remove the xhtml-im that was inserted for debug, add the start of a method to enter attributes in Inputs, convert \n to <br /> in xhtml_im bodies and put that body in a <p> element
Diffstat (limited to 'src/xhtml.py')
-rw-r--r--src/xhtml.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/xhtml.py b/src/xhtml.py
index bfdc1ef6..be09442b 100644
--- a/src/xhtml.py
+++ b/src/xhtml.py
@@ -64,7 +64,7 @@ def poezio_colors_to_html(string):
# a list of all opened elements, e.g. ['strong', 'span']
# So that we know what we need to close
opened_elements = []
- res = "<body xmlns='http://www.w3.org/1999/html'>"
+ res = "<body xmlns='http://www.w3.org/1999/html'><p>"
next_attr_char = string.find('\x19')
while next_attr_char != -1:
attr_char = string[next_attr_char+1].lower()
@@ -90,8 +90,8 @@ def poezio_colors_to_html(string):
res += string
for elem in opened_elements[::-1]:
res += '</%s>' % (elem,)
- res += "</body>"
- return res
+ res += "</p></body>"
+ return res.replace('\n', '<br />')
def shell_colors_to_poezio_colors(string):
"""