remove CDATA and html tags

This commit is contained in:
Luis Miguel Almánzar 2013-05-26 15:43:29 -04:00
parent a16655e22e
commit 3c71f466e9

View File

@ -1,5 +1,6 @@
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Text.RegularExpressions;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
@ -145,7 +146,14 @@ namespace MediaBrowser.Controller.Providers
case "Overview": case "Overview":
case "Description": case "Description":
item.Overview = reader.ReadInnerXml(); var overview = reader.ReadInnerXml();
const string cdataRegex = @"\<\!\[CDATA\[(?<text>.*)\]\]\>";
if (Regex.IsMatch(overview, cdataRegex))
{
var match = Regex.Match(overview, cdataRegex);
overview = match.Groups["text"].Value;
}
item.Overview = Regex.Replace(overview, @"\<[^\>]*\>", string.Empty);
break; break;
case "TagLine": case "TagLine":