[evolution/wip/webkit2] EHTMLEditorView - Some empty new lines in a quoted content could be lost



commit e68681fa30ab1cbda8d50d55753d92d369a5a078
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Jun 29 15:51:19 2016 +0200

    EHTMLEditorView - Some empty new lines in a quoted content could be lost

 .../web-extension/e-editor-dom-functions.c         |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
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 7a5cff6..efd942a 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -5215,6 +5215,8 @@ parse_html_into_blocks (EEditorPage *editor_page,
        while (next_br) {
                gboolean local_ignore_next_br = ignore_next_br;
                gboolean local_preserve_next_line = preserve_next_line;
+               gboolean local_previously_had_empty_citation_start =
+                       previously_had_empty_citation_start;
                gboolean preserve_block = TRY_TO_PRESERVE_BLOCKS;
                const gchar *citation = NULL, *citation_end = NULL;
                const gchar *rest = NULL, *with_br = NULL;
@@ -5423,6 +5425,14 @@ parse_html_into_blocks (EEditorPage *editor_page,
                                        parent,
                                        block_template,
                                        "<br id=\"-x-evo-first-br\">");
+                       } else if (local_previously_had_empty_citation_start &&
+                                  !citation && with_br && rest && !*rest) {
+                               /* Empty citation */
+                               if (block)
+                                       append_new_block (parent, &block);
+
+                               block = create_and_append_new_block (
+                                       editor_page, parent, block_template, "<br>");
                        } else
                                preserve_next_line = FALSE;
                } else if (first_element && !citation_was_first_element) {


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