Skip to content

Instantly share code, notes, and snippets.

@rhysgodfrey
Created June 14, 2016 15:40
Show Gist options
  • Save rhysgodfrey/884eb41e711cdef7e8f59c1ba854c3df to your computer and use it in GitHub Desktop.
Save rhysgodfrey/884eb41e711cdef7e8f59c1ba854c3df to your computer and use it in GitHub Desktop.
private readonly Regex _iframeRegex = new Regex(@"<iframe(.*)src=""(?<url>[^""].*?)""(.*?)/>", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
public string Body
{
get
{
return _iframeRegex.Replace(_body, (match) =>
{
return string.Format(@"<iframe src=""{0}"" frameborder=""0"" webkitallowfullscreen="""" mozallowfullscreen="""" allowfullscreen=""""></iframe>", match.Groups["url"].Value);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment