diff options
author | Dan Winship <danw@src.gnome.org> | 2001-04-30 00:59:00 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-04-30 00:59:00 +0800 |
commit | aeac2bb33b90f205f40d047eb02b3d938287b66e (patch) | |
tree | 5394d78f5e0cf7bde8adeefb375d9c243e7bf451 /mail | |
parent | 2a281b9296e36a68c0797cf3a271b964789a1cd9 (diff) | |
download | gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar.gz gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar.bz2 gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar.lz gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar.xz gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.tar.zst gsoc2013-evolution-aeac2bb33b90f205f40d047eb02b3d938287b66e.zip |
Mojo this a bit so that "\n\n>" gets translated to "<br><blockquote>"
* 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.
svn path=/trunk/; revision=9627
Diffstat (limited to 'mail')
-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; |