[evolution/gnome-3-38] I#1156 - Composer: HTML email signature not stripped



commit e4744599169853f0e8d26ed1c41d3282eb374e67
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 15 14:35:21 2020 +0200

    I#1156 - Composer: HTML email signature not stripped
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1156

 src/em-format/e-mail-stripsig-filter.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/em-format/e-mail-stripsig-filter.c b/src/em-format/e-mail-stripsig-filter.c
index be2d29546d..809e001df1 100644
--- a/src/em-format/e-mail-stripsig-filter.c
+++ b/src/em-format/e-mail-stripsig-filter.c
@@ -36,7 +36,15 @@ is_html_newline_marker (const gchar *text,
 {
        const gchar *cases[] = {
                "<br>",
-               "div><br></div>",
+               "<div>",
+               "<div ",
+               "</div>",
+               "<p>",
+               "<p ",
+               "</p>",
+               "<pre>",
+               "<pre ",
+               "</pre>",
                NULL };
        gint ii;
 
@@ -49,6 +57,16 @@ is_html_newline_marker (const gchar *text,
                gint caselen = strlen (cases[ii]);
 
                if (len >= caselen && g_ascii_strncasecmp (text, cases[ii], caselen) == 0) {
+                       if (cases[ii][caselen - 1] != '>') {
+                               /* Need to find the tag end, in a lazy way */
+                               while (text[caselen] && text[caselen] != '>')
+                                       caselen++;
+
+                               /* Advance after the '>' */
+                               if (text[caselen])
+                                       caselen++;
+                       }
+
                        *advance_by_chars = caselen;
                        return TRUE;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]