Don't depend on protocol in video regex

This commit is contained in:
2014-01-11 10:00:00 +01:00
parent 466518d57c
commit 845b1438fb
2 changed files with 13 additions and 11 deletions
@@ -111,7 +111,7 @@ namespace ReadSharp.Ports.NReadability
private static readonly Regex _BreakBeforeParagraphRegex = new Regex("<br[^>]*>\\s*<p");
private static readonly Regex _NormalizeSpacesRegex = new Regex("\\s{2,}");
private static readonly Regex _KillBreaksRegex = new Regex("(<br\\s*\\/?>(\\s|&nbsp;?)*){1,}");
private static readonly Regex _VideoRegex = new Regex("http:\\/\\/(www\\.)?(youtube|vimeo)\\.com", RegexOptions.IgnoreCase);
private static readonly Regex _VideoRegex = new Regex("\\/\\/(www\\.)?(youtube|vimeo)\\.com", RegexOptions.IgnoreCase);
private static readonly Regex _ReplaceDoubleBrsRegex = new Regex("(<br[^>]*>[ \\n\\r\\t]*){2,}", RegexOptions.IgnoreCase);
private static readonly Regex _ReplaceFontsRegex = new Regex("<(\\/?)font[^>]*>", RegexOptions.IgnoreCase);
private static readonly Regex _ArticleTitleDashRegex1 = new Regex(" [\\|\\-] ");
@@ -1435,6 +1435,8 @@ namespace ReadSharp.Ports.NReadability
var elementsToRemove = new List<XElement>();
// TODO: proof iframe videos
foreach (XElement element in elements)
{
/* Allow youtube and vimeo videos through as people usually want to see those. */