[evolution/gnome-3-22] Extra new line on the end of mail and after citation end



commit 58fd02a1d26a12aad95770e06137f7a5de001079
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Sep 20 11:01:34 2016 +0200

    Extra new line on the end of mail and after citation end

 e-util/test-html-editor-units.c                    |    2 +-
 .../web-extension/e-editor-dom-functions.c         |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/e-util/test-html-editor-units.c b/e-util/test-html-editor-units.c
index 7a3134c..9d53db5 100644
--- a/e-util/test-html-editor-units.c
+++ b/e-util/test-html-editor-units.c
@@ -2154,7 +2154,7 @@ test_cite_reply_plain (TestFixture *fixture)
 
        test_utils_insert_content (fixture,
                "<pre>line 1\n"
-               "line 2\n"
+               "line 2\n\n"
                "</pre><span class=\"-x-evo-to-body\" data-credits=\"On Today, User wrote:\"></span>"
                "<span class=\"-x-evo-cite-body\"></span>",
                E_CONTENT_EDITOR_INSERT_REPLACE_ALL | E_CONTENT_EDITOR_INSERT_TEXT_HTML);
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c 
b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index 5abb918..2236e9f 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -5043,6 +5043,7 @@ remove_new_lines_around_citations (const gchar *input)
        /* Remove the new lines around citations:
         * Replace <br><br>##CITATION_START## with <br>##CITATION_START##
         * Replace ##CITATION_START##<br><br> with ##CITATION_START##<br>
+        * Replace ##CITATION_END##<br><br> with ##CITATION_END##<br>
         * Replace <br>##CITATION_END## with ##CITATION_END##
         * Replace <br>##CITATION_START## with ##CITATION_START## */
        p = input;
@@ -5057,7 +5058,6 @@ remove_new_lines_around_citations (const gchar *input)
                /* ##CITATION_START## */
                if (citation_type == 'S') {
                        if (g_str_has_suffix (str->str, "<br><br>") ||
-                           g_str_has_suffix (str->str, "<br><br>") ||
                            g_str_has_suffix (str->str, "<br>"))
                                g_string_truncate (str, str->len - 4);
 
@@ -5069,6 +5069,12 @@ remove_new_lines_around_citations (const gchar *input)
                } else if (citation_type == 'E') {
                        if (g_str_has_suffix (str->str, "<br>"))
                                g_string_truncate (str, str->len - 4);
+
+                       if (g_str_has_prefix (next + 11, "END##<br><br>")) {
+                               g_string_append (str, "##CITATION_END##<br>");
+                               p = next + 24;
+                               continue;
+                       }
                }
 
                g_string_append (str, "##CITATION_");


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