From aeac2bb33b90f205f40d047eb02b3d938287b66e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 29 Apr 2001 16:59:00 +0000 Subject: Mojo this a bit so that "\n\n>" gets translated to "
" * mail-format.c (handle_text_plain_flowed): Mojo this a bit so that "\n\n>" gets translated to "
" rather than "

", since the transition to blockquote mode creates a blank line itself. Makes Mozilla-generated flowed replies look better. svn path=/trunk/; revision=9627 --- mail/ChangeLog | 8 ++++++++ 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 + + * mail-format.c (handle_text_plain_flowed): Mojo this a bit so + that "\n\n>" gets translated to "
" rather than + "

", since the transition to blockquote mode + creates a blank line itself. Makes Mozilla-generated flowed + replies look better. + 2001-04-27 Dan Winship * 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) "
"); prevquoting++; } + if (br_pending) + br_pending--; while (quoting < prevquoting) { mail_html_write (md->html, md->stream, "
"); @@ -994,13 +995,20 @@ handle_text_plain_flowed (char *buf, MailDisplay *md) mail_html_write (md->html, md->stream, "\n"); } - } else if (br_pending) { - mail_html_write (md->html, md->stream, "
\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, "
\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; -- cgit v1.2.3