diff --git a/libempathy-gtk/empathy-string-parser.c b/libempathy-gtk/empathy-string-parser.c
index 5c3fb19..52c726c 100644
--- a/libempathy-gtk/empathy-string-parser.c
+++ b/libempathy-gtk/empathy-string-parser.c
@@ -185,9 +185,23 @@ empathy_string_replace_escaped (const gchar *text,
 {
 	GString *string = user_data;
 	gchar *escaped;
+	guint i;
+	gssize escaped_len, old_len;
 
 	escaped = g_markup_escape_text (text, len);
-	g_string_append (string, escaped);
+	escaped_len = strlen (escaped);
+
+	/* Allocate more space to string (we really need a g_string_extend...) */
+	old_len = string->len;
+	g_string_set_size (string, old_len + escaped_len);
+	g_string_truncate (string, old_len);
+
+	/* Remove '\r' */
+	for (i = 0; i < escaped_len; i++) {
+		if (escaped[i] != '\r')
+			g_string_append_c (string, escaped[i]);
+	}
+
 	g_free (escaped);
 }
 
diff --git a/tests/empathy-parser-test.c b/tests/empathy-parser-test.c
index 9562a37..5713d96 100644
--- a/tests/empathy-parser-test.c
+++ b/tests/empathy-parser-test.c
@@ -25,17 +25,6 @@ test_replace_match (const gchar *text,
 }
 
 static void
-test_replace_verbatim (const gchar *text,
-                       gssize len,
-                       gpointer match_data,
-                       gpointer user_data)
-{
-  GString *string = user_data;
-
-  g_string_append_len (string, text, len);
-}
-
-static void
 test_parsers (void)
 {
   gchar *tests[] =
@@ -70,25 +59,29 @@ test_parsers (void)
       "Foo (www.foo.com)", "Foo ([www.foo.com])",
       "Foo {www.foo.com}", "Foo {[www.foo.com]}",
       "Foo [www.foo.com]", "Foo [[www.foo.com]]",
-      "Foo <www.foo.com>", "Foo <[www.foo.com]>",
-      "Foo \"www.foo.com\"", "Foo \"[www.foo.com]\"",
+      "Foo <www.foo.com>", "Foo &lt;[www.foo.com]&gt;",
+      "Foo \"www.foo.com\"", "Foo &quot;[www.foo.com]&quot;",
       "Foo (www.foo.com/bar(123)baz)", "Foo ([www.foo.com/bar(123)baz])",
-      "<a href=\"http://foo.com\">bar</a>", "<a href=\"[http://foo.com]\">bar</a>",
+      "<a href=\"http://foo.com\">bar</a>", "&lt;a href=&quot;[http://foo.com]&quot;&gt;bar&lt;/a&gt;",
       "Foo (user@server.com)", "Foo ([user@server.com])",
       "Foo {user@server.com}", "Foo {[user@server.com]}",
       "Foo [user@server.com]", "Foo [[user@server.com]]",
-      "Foo <user@server.com>", "Foo <[user@server.com]>",
-      "Foo \"user@server.com\"", "Foo \"[user@server.com]\"",
+      "Foo <user@server.com>", "Foo &lt;[user@server.com]&gt;",
+      "Foo \"user@server.com\"", "Foo &quot;[user@server.com]&quot;",
 
       /* Basic smileys */
       "a:)b", "a[:)]b",
       ">:)", "[>:)]",
-      ">:(", ">[:(]",
+      ">:(", "&gt;[:(]",
 
       /* Smileys and links mixed */
       ":)http://foo.com", "[:)][http://foo.com]",
       "a :) b http://foo.com c :( d www.test.com e", "a [:)] b [http://foo.com] c [:(] d [www.test.com] e",
 
+      /* '\r' should be stripped */
+      "badger\n\rmushroom", "badger\nmushroom",
+      "badger\r\nmushroom", "badger\nmushroom",
+
       /* FIXME: Known issue: Brackets should be counted by the parser */
       //"Foo www.bar.com/test(123)", "Foo [www.bar.com/test(123)]",
       //"Foo (www.bar.com/test(123))", "Foo ([www.bar.com/test(123)])",
@@ -102,11 +95,10 @@ test_parsers (void)
     {
       {empathy_string_match_link, test_replace_match},
       {empathy_string_match_smiley, test_replace_match},
-      {empathy_string_match_all, test_replace_verbatim},
+      {empathy_string_match_all, empathy_string_replace_escaped},
       {NULL, NULL}
     };
   guint i;
-  gboolean failed = FALSE;
 
   DEBUG ("Started");
   for (i = 0; tests[i] != NULL; i += 2)
@@ -119,13 +111,10 @@ test_parsers (void)
 
       ok = !tp_strdiff (tests[i + 1], string->str);
       DEBUG ("'%s' => '%s': %s", tests[i], string->str, ok ? "OK" : "FAILED");
-      if (!ok)
-        failed = TRUE;
+      g_assert (ok);
 
       g_string_free (string, TRUE);
     }
-
-  g_assert (!failed);
 }
 
 int
