[blam] Handle HTML entities better



commit c79c10a101533d42f797699a80750cfa26b830ec
Author: Carlos MartÃn Nieto <cmn dwim me>
Date:   Wed Jan 16 02:40:24 2013 +0100

    Handle HTML entities better
    
    Don't escape the HTML when showing it in the WebView, as it makes it
    show the entities instead of the character they represent.
    
    Conversely, unescape them when showing them in the ListView, as pango
    doesn't read HTML.

 src/ItemList.cs |    3 ++-
 src/ItemView.cs |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/ItemList.cs b/src/ItemList.cs
index fac1dab..208716d 100644
--- a/src/ItemList.cs
+++ b/src/ItemList.cs
@@ -255,7 +255,8 @@ namespace Imendio.Blam {
 		weight = (int) Pango.Weight.Bold;
 	    }
 
-        ((CellRendererText)cell).Text = (item.Title as TextSyndicationContent).Text.Trim();
+
+        ((CellRendererText)cell).Text = HtmlUtils.Unescape((item.Title as TextSyndicationContent).Text.Trim());
         ((CellRendererText)cell).Weight = weight;
         ((CellRendererText)cell).Ellipsize = Pango.EllipsizeMode.End;
 	}
diff --git a/src/ItemView.cs b/src/ItemView.cs
index 27721ee..8ae1400 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -116,7 +116,7 @@ namespace Imendio.Blam {
 				  Catalog.GetString("[No date available]");
             string text = currentItem.Summary != null ? currentItem.Summary.Text
                 : currentItem.Content != null ? (currentItem.Content as TextSyndicationContent).Text : null;
-            string title   = HtmlUtils.Escape(currentItem.Title.Text);
+			string title = currentItem.Title.Text;
             string url = currentItem.Links.Count == 0 ? currentItem.Id :
                 currentItem.Links[0].Uri.ToString();
 



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