Fix ampersand handling in Span class
authorAdam Szczerbiak <a.szczerbiak@samsung.com>
Wed, 1 Feb 2017 05:49:24 +0000 (06:49 +0100)
committerKangho Hur <kangho.hur@samsung.com>
Mon, 24 Apr 2017 04:36:52 +0000 (13:36 +0900)
Ampersand character ('&') has not been handled correctly, causing the
text handled by Span class to display solely the initial part, up to the
first '&' character.
This bug has been spotted in Xamarin.Samples.TipCalc application, where
the displayed label's caption stated "Food ", but pre-programmed string
was "Food & Drink".
This commit makes the Span class handle the '&' character correctly,
which fixes that bug.

Change-Id: I0e17d39fbfae6a5ef5eea585a5229c4a5b0cca7e
Signed-off-by: Adam Szczerbiak <a.szczerbiak@samsung.com>
Xamarin.Forms.Platform.Tizen/Native/Span.cs

index 028e9db..41a20b7 100644 (file)
@@ -318,7 +318,8 @@ namespace Xamarin.Forms.Platform.Tizen.Native
 
                string ConvertTags(string text)
                {
-                       return text.Replace("<", "&lt;")
+                       return text.Replace("&", "&amp;")
+                                          .Replace("<", "&lt;")
                                           .Replace(">", "&gt;")
                                           .Replace(Environment.NewLine, "<br>");
                }