From e14c6141596aac5b34250f0a994cfa4f73516fcc Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 6 Sep 2001 19:47:46 +0000 Subject: Add E_TEXT_TO_HTML_CITE, to prepend "> " to each line. * e-html-utils.c (e_text_to_html_full): Add E_TEXT_TO_HTML_CITE, to prepend "> " to each line. svn path=/trunk/; revision=12655 --- e-util/ChangeLog | 5 +++++ e-util/e-html-utils.c | 8 +++++++- e-util/e-html-utils.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 8c08abcd69..b664b9a45c 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2001-09-06 Dan Winship + + * e-html-utils.c (e_text_to_html_full): Add E_TEXT_TO_HTML_CITE, + to prepend "> " to each line. + 2001-09-05 Dan Winship * e-mktemp.c (get_path): Fix the check for the case when mkdir() diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index ac4e35c0f6..03c1c36117 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -197,6 +197,9 @@ is_citation (const unsigned char *c, gboolean saw_citation) * citations (lines beginning with "> ", etc). * * - E_TEXT_TO_HTML_ESCAPE_8BIT: flatten everything to US-ASCII + * + * - E_TEXT_TO_HTML_CITE: quote the text with "> " at the start of each + * line. **/ char * e_text_to_html_full (const char *input, unsigned int flags, guint32 color) @@ -213,7 +216,7 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) out = buffer; if (flags & E_TEXT_TO_HTML_PRE) - out += sprintf (out, "
\n");
+		out += sprintf (out, "
");
 
 	col = 0;
 
@@ -243,6 +246,9 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color)
 			/* Display mbox-mangled ">From" as "From" */
 			if (*cur == '>' && !saw_citation)
 				cur++;
+		} else if (flags & E_TEXT_TO_HTML_CITE && col == 0) {
+			check_size (&buffer, &buffer_size, out, 5);
+			out += sprintf (out, "> ");
 		}
 
 		u = g_utf8_get_char (cur);
diff --git a/e-util/e-html-utils.h b/e-util/e-html-utils.h
index 0a0d843e17..812fe06d58 100644
--- a/e-util/e-html-utils.h
+++ b/e-util/e-html-utils.h
@@ -32,6 +32,7 @@
 #define E_TEXT_TO_HTML_MARK_CITATION     (1 << 4)
 #define E_TEXT_TO_HTML_CONVERT_ADDRESSES (1 << 5)
 #define E_TEXT_TO_HTML_ESCAPE_8BIT       (1 << 6)
+#define E_TEXT_TO_HTML_CITE              (1 << 7)
 
 char *e_text_to_html_full (const char *input, unsigned int flags, guint32 color);
 char *e_text_to_html      (const char *input, unsigned int flags);
-- 
cgit v1.2.3