[evolution/gnome-3-20] EHTMLEditorView - Don't replace various whitespaces with non-breaking spaces when inserting into PRE
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-20] EHTMLEditorView - Don't replace various whitespaces with non-breaking spaces when inserting into PRE
- Date: Fri, 8 Apr 2016 07:31:37 +0000 (UTC)
commit 3dbaf3fdbb174e3fe198442181722b98536a6009
Author: Tomas Popela <tpopela redhat com>
Date: Wed Mar 30 13:29:30 2016 +0200
EHTMLEditorView - Don't replace various whitespaces with non-breaking spaces when inserting into PRE
element
e-util/e-html-editor-view.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 5594ef8..865e5af 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -7481,9 +7481,14 @@ parse_html_into_blocks (EHTMLEditorView *view,
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]