/// <summary>
/// Takes HTML and list of all positions of h3 tags and splits them.
/// </summary>
...
public string CleanHtml(object Html) {
var s = Html.ToString();
var b = new StringBuilder();
...
C# C# HTML Encoding
This is my own attempt at w...
/// <summary>
/// This function actually alters the text and makes the necessary changes.
/// </summary>
...
C# HTML Reprocessing Code
The code below is evil. It'...
private static Regex _namedtags = new Regex
(@"</?(?<tagname>\w+)[^>]*(\s|$|>)",
RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
...
C# Balance HTML Tags
For the subset of HTML tags...
private static Regex _tags = new Regex("<[^>]*(>|$)",
RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
private static Regex _whitelist = new Regex(@"
...
C# Sanitize HTML
Takes a provided HTML strin...
The HTML is pre-parsed to g...