public string EditString(string bodyHTML)
{
string _newlineReplacement = " ";
string htmlDecoded = System.Net.WebUtility.HtmlDecode(bodyHTML);
string removeNewline = Regex.Replace(htmlDecoded, @"\r\n?|\n", _newlineReplacement);
string htmlPage = string.Format(@"<html><head>
<meta name=viewport content='width=device-width, height=device-height, initial-scale=1' />
<meta name='msapplication-tap-highlight' content='no' />
<style type='text/css'>
html {{
width: {0};
height: {1};
border-radius: 4px;
overflow-x: hidden;
overflow-y: hidden;
overflow: hidden;
}}
* {{
-ms-user-select: none;
}}
span {{
width: {0} !important;
height: {1} !important;
max-width: {3} !important;
}}
iframe {{
width: {0} !important;
height: {1} !important;
max-width: {3} !important;
}}
iframe[title=""fb:video Facebook Social Plugin""] {{
width: {0} !important;
height: {1} !important;
max-width: {3} !important;
border-radius: 4px;
overflow: hidden;
}}
.fb_iframe_widget {{
display: block !important;
}}
.instagram-media {{
max-width: {3} !important;
}}
</style>
</head><body><div id=""content"" onload=""h()"">{2}</div></body>
</html>", "100%", "100%", removeNewline, "100%");
if (htmlPage.Contains("//platform.twitter.com/widgets.js"))
{
htmlPage = Regex.Replace(htmlPage, "//platform.twitter.com/widgets.js", "https://platform.twitter.com/widgets.js");
}
if (htmlPage.Contains("//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"))
{
htmlPage = Regex.Replace(htmlPage, "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3", "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3");
}
if (htmlPage.Contains("//platform.instagram.com/en_US/embeds.js"))
{
htmlPage = Regex.Replace(htmlPage, "//platform.instagram.com/en_US/embeds.js", "https://platform.instagram.com/en_US/embeds.js");
}
return htmlPage;
}