[evolution/wip/webkit2] EHTMLEditorView - Don't replace various whitespaces with non-breaking spaces when inserting into PR



commit 6244d135915667465d5afd2f683998c8454303e0
Author: Tomas Popela <tpopela redhat com>
Date:   Tue May 31 10:51:44 2016 +0200

     EHTMLEditorView - Don't replace various whitespaces with non-breaking spaces when inserting into PRE 
element

 .../e-html-editor-view-dom-functions.c             |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/modules/webkit-content-editor/web-extension/e-html-editor-view-dom-functions.c 
b/modules/webkit-content-editor/web-extension/e-html-editor-view-dom-functions.c
index ecee6ea..9c947e4 100644
--- a/modules/webkit-content-editor/web-extension/e-html-editor-view-dom-functions.c
+++ b/modules/webkit-content-editor/web-extension/e-html-editor-view-dom-functions.c
@@ -4656,9 +4656,14 @@ parse_html_into_blocks (WebKitDOMDocument *document,
        prev_br = html;
        next_br = strstr (prev_br, "<br>");
 
-       /* Replace single spaces on the beginning of line, 2+ spaces and
-        * tabulators with non breaking spaces */
-       regex_nbsp = g_regex_new ("^\\s{1}|\\s{2,}|\x9|\\s$", 0, 0, NULL);
+       /* Replace the tabulators with SPAN elements that corresponds to them.
+        * If not inserting the content into the PRE element also replace single
+        * spaces on the beginning of line, 2+ spaces and with non breaking
+        * spaces. */
+       if (WEBKIT_DOM_IS_HTML_PRE_ELEMENT (block_template))
+               regex_nbsp = g_regex_new ("\x9", 0, 0, NULL);
+       else
+               regex_nbsp = g_regex_new ("^\\s{1}|\\s{2,}|\x9|\\s$", 0, 0, NULL);
 
        while (next_br) {
                gboolean local_ignore_next_br = ignore_next_br;


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