]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: Treat > as quote for HTML mails too
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Oct 2019 13:11:18 +0000 (15:11 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 5 Nov 2019 11:54:01 +0000 (13:54 +0200)
src/lib-mail/message-snippet.c
src/lib-mail/test-message-snippet.c

index b33bbae60a95f75a8391d5925e980debfebb21a3..837edd22ef61e2358532e380edd12f8591bc1dd5 100644 (file)
@@ -94,7 +94,7 @@ static bool snippet_generate(struct snippet_context *ctx,
                count = 1;
                switch (ctx->state) {
                case SNIPPET_STATE_NEWLINE:
-                       if (data[i] == '>' && ctx->html2text == NULL) {
+                       if (data[i] == '>') {
                                ctx->state = SNIPPET_STATE_QUOTED;
                                i++;
                                target = &ctx->quoted_snippet;
@@ -160,7 +160,7 @@ int message_snippet_generate(struct istream *input,
                        if (ct == NULL)
                                /* text/plain */ ;
                        else if (mail_html2text_content_type_match(ct)) {
-                               ctx.html2text = mail_html2text_init(MAIL_HTML2TEXT_FLAG_SKIP_QUOTED);
+                               ctx.html2text = mail_html2text_init(0);
                                ctx.plain_output = buffer_create_dynamic(pool, 1024);
                        } else if (strncasecmp(ct, "text/", 5) != 0)
                                break;
index 623afabb83541d6ad3d6a7e160d4851d1e4a9c87..e2b79c7c8c68e285dc4b972064b4a7ed81c5acc0 100644 (file)
@@ -50,7 +50,7 @@ static const struct {
          "&gt; -foo\n"
          "</div><br =class=3D\"\"></body></html>=\n",
          100,
-         "Hi, How is it going? > -foo" },
+         "Hi, How is it going?" },
 
        { "Content-Transfer-Encoding: quoted-printable\n"
          "Content-Type: application/xhtml+xml;\n"
@@ -64,7 +64,7 @@ static const struct {
          "&gt; -foo\n"
          "</div><br =class=3D\"\"></body></html>=\n",
          100,
-         "Hi, How is it going? > -foo" },
+         "Hi, How is it going?" },
        { "Content-Type: text/plain\n"
          "\n"
          ">quote1\n>quote2\n",
@@ -90,7 +90,7 @@ static const struct {
           "class=3D\"\"><div><blockquote>quoted text is included</blockquote>\n"
           "</div><br =class=3D\"\"></body></html>=\n",
           100,
-          "" },
+          ">quoted text is included" },
 };
 
 static void test_message_snippet(void)