Better handling of spaces on converting text to html
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 3 Sep 2009 10:55:01 +0000 (12:55 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 3 Sep 2009 17:26:38 +0000 (19:26 +0200)
src/modest-text-utils.c

index 5b7c0bd..8161ae5 100644 (file)
@@ -454,7 +454,7 @@ modest_text_utils_convert_buffer_to_html_start (GString *html, const gchar *data
                guchar kar = data[i];
                
                if (space_seen && kar != ' ') {
                guchar kar = data[i];
                
                if (space_seen && kar != ' ') {
-                       g_string_append (html, "&nbsp;");
+                       g_string_append (html, " ");
                        space_seen = FALSE;
                }
                
                        space_seen = FALSE;
                }
                
@@ -491,7 +491,6 @@ modest_text_utils_convert_buffer_to_html_start (GString *html, const gchar *data
                        break_dist = 0;
                        if (space_seen) { /* second space in a row */
                                g_string_append (html, "&nbsp; ");
                        break_dist = 0;
                        if (space_seen) { /* second space in a row */
                                g_string_append (html, "&nbsp; ");
-                               space_seen = FALSE;
                        } else
                                space_seen = TRUE;
                        break;
                        } else
                                space_seen = TRUE;
                        break;