I have a large htmlencoded string and i want decode only specific whitelisted html tags.
Is there a way to do this in c#, WebUtility.HtmlDecode() decodes everything.
You could do something like this
public string DecodeSpecificTags(List whiteListedTagNames,string encodedInput) { String regex=""; foreach(string s in whiteListedTagNames) { regex="<"+@"\s*/?\s*"+s+".*?"+">"; encodedInput=Regex.Replace(encodedInput,regex); } return encodedInput; }