fix subtitle unit tests

This commit is contained in:
Luke Pulverenti
2014-08-31 14:28:20 -04:00
parent 6e25c572fa
commit bdc04cda17
9 changed files with 46 additions and 22 deletions

View File

@@ -4,6 +4,7 @@ using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
using MediaBrowser.Common.Extensions;
namespace MediaBrowser.MediaEncoding.Subtitles
{
@@ -48,7 +49,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
multiline.Add(line);
}
subEvent.Text = string.Join(@"\n", multiline);
subEvent.Text = string.Join(ParserValues.NewLine, multiline);
subEvent.Text = subEvent.Text.Replace(@"\N", ParserValues.NewLine, StringComparison.OrdinalIgnoreCase);
subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);
subEvent.Text = Regex.Replace(subEvent.Text, "<", "&lt;", RegexOptions.IgnoreCase);
subEvent.Text = Regex.Replace(subEvent.Text, ">", "&gt;", RegexOptions.IgnoreCase);