mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
fixed #80
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:
@@ -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 == "":
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user