diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-format.c | 23 |
2 files changed, 23 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index fd88414b58..593afac972 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2001-04-29 Dan Winship <danw@ximian.com> + + * mail-format.c (handle_text_plain_flowed): Mojo this a bit so + that "\n\n>" gets translated to "<br><blockquote>" rather than + "<br><br><blockquote>", since the transition to blockquote mode + creates a blank line itself. Makes Mozilla-generated flowed + replies look better. + 2001-04-27 Dan Winship <danw@ximian.com> * mail-session.c: Renamed from session.c and made to be a subclass diff --git a/mail/mail-format.c b/mail/mail-format.c index 036a36a84b..81766f6206 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -958,8 +958,7 @@ static gboolean handle_text_plain_flowed (char *buf, MailDisplay *md) { char *text, *line, *eol, *p; - int prevquoting = 0, quoting, len; - gboolean br_pending = FALSE; + int prevquoting = 0, quoting, len, br_pending = 0; guint32 citation_color = mail_config_get_citation_color (); mail_html_write (md->html, md->stream, @@ -985,6 +984,8 @@ handle_text_plain_flowed (char *buf, MailDisplay *md) "<blockquote>"); prevquoting++; } + if (br_pending) + br_pending--; while (quoting < prevquoting) { mail_html_write (md->html, md->stream, "</blockquote>"); @@ -994,13 +995,20 @@ handle_text_plain_flowed (char *buf, MailDisplay *md) mail_html_write (md->html, md->stream, "</font>\n"); } - } else if (br_pending) { - mail_html_write (md->html, md->stream, "<br>\n"); - br_pending = FALSE; } if (*p == ' ') p++; + len = strlen (p); + if (len == 0) { + br_pending++; + continue; + } + + while (br_pending) { + mail_html_write (md->html, md->stream, "<br>\n"); + br_pending--; + } /* replace '<' with '<', etc. */ text = e_text_to_html (p, E_TEXT_TO_HTML_CONVERT_SPACES | @@ -1009,9 +1017,8 @@ handle_text_plain_flowed (char *buf, MailDisplay *md) mail_html_write (md->html, md->stream, "%s", text); g_free (text); - len = strlen (p); - if (len == 0 || p[len - 1] != ' ' || !strcmp (p, "-- ")) - br_pending = TRUE; + if (p[len - 1] != ' ' || !strcmp (p, "-- ")) + br_pending++; if (!eol) break; |