/// <summary>
        /// Takes HTML and list of all positions of h3 tags and splits them.
        /// </summary>
...

C# Split HTML from header tag ...

by Ender, March 09, 2011 12:52, 2 refactorings, tagged with string, html, C#, parse

The HTML is pre-parsed to g...

C98e188ba63a7875d61a77d7aaa3f5c7 Talk
public string CleanHtml(object Html) {
	var s = Html.ToString();
	var b = new StringBuilder();
...

C# C# HTML Encoding

by GateKiller, March 05, 2009 15:08, 6 refactorings, tagged with html, C#, sanitize

This is my own attempt at w...

98c852e2d9b26249745ea92c72964d3f Talk
/// <summary>
    /// This function actually alters the text and makes the necessary changes.
    /// </summary>
...

C# HTML Reprocessing Code

by nesteruk, February 23, 2009 15:07, 2 refactorings, tagged with html, C#, parse

The code below is evil. It'...

F01cbd2238e2a78e4c43fa596f51d6a1 Talk
private static Regex _namedtags = new Regex
    (@"</?(?<tagname>\w+)[^>]*(\s|$|>)",
    RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
...

C# Balance HTML Tags

by Jeff Atwood, July 11, 2008 08:40, 30 refactorings, tagged with tags, html, balance, unbalanced

For the subset of HTML tags...

51d623f33f8b83095db84ff35e15dbe8 Talk
private static Regex _tags = new Regex("<[^>]*(>|$)",
    RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
private static Regex _whitelist = new Regex(@"
...

C# Sanitize HTML

by Jeff Atwood, June 20, 2008 08:24, 64 refactorings, tagged with html, xss, sanitize

Takes a provided HTML strin...

51d623f33f8b83095db84ff35e15dbe8 Talk