The real problem was due to the use of a <pre> tag to display plaintext messages. By default, it does not automatically cut long lines as with other tags. Some CSS stuff fixed the problem.

Fixed bad behaviour on some combinations between display mode and message available formats. (ie. plain/text or plain/html)
This commit is contained in:
Antoine Nguyen
2011-02-04 10:39:47 +01:00
parent 45c6117efc
commit 24431b3439
2 changed files with 10 additions and 2 deletions
+3 -2
View File
@@ -152,6 +152,8 @@ class Email(object):
self.__parse(msg)
print "mf : %s, df : %s" % (mformat, dformat)
if not self.contents.has_key(mformat) or self.contents[mformat] == "":
# Fallback
self.mformat = mformat == "html" and "plain" or "html"
@@ -280,8 +282,7 @@ class Email(object):
})
def viewmail_plain(self, content, **kwargs):
return self.dformat == "html" and "<pre>%s</pre>" % content \
or content
return "<pre>%s</pre>" % content
def viewmail_html(self, content, **kwargs):
if content is None or content == "":
+7
View File
@@ -10,6 +10,13 @@
body {
margin: 5px;
}
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
#mailcontent {
width: 100%;
border: 0px transparent none;