[evolution/gnome-3-24] Bug 781570 - Replace Unicode NBSP to ASCII space in text/plain before send



commit 6d31abb8419e9cfea338229cf184cc3b326b282f
Author: Milan Crha <mcrha redhat com>
Date:   Fri Apr 21 11:17:25 2017 +0200

    Bug 781570 - Replace Unicode NBSP to ASCII space in text/plain before send

 .../web-extension/e-editor-dom-functions.c         |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c 
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index c9ad343..f73f432 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -7463,6 +7463,16 @@ process_node_to_plain_text_for_exporting (EEditorPage *editor_page,
                                g_regex_unref (regex);
                        }
 
+                       if (strstr (content, UNICODE_NBSP)) {
+                               gchar *tmp;
+
+                               regex = g_regex_new (UNICODE_NBSP, 0, 0, NULL);
+                               tmp = g_regex_replace (regex, content, -1, 0, " ", 0, NULL);
+                               g_free (content);
+                               content = tmp;
+                               g_regex_unref (regex);
+                       }
+
                        class = webkit_dom_element_get_class_name (WEBKIT_DOM_ELEMENT (source));
                        if (class && (css_align = strstr (class, "-x-evo-align-"))) {
                                gchar *content_with_align;


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