tagname = tag.Groups["tagname"].ToString();

if (!ignoredtags.Contains("<" + tagname))
...

C# On Balance HTML Tags

by Paul Celi, July 12, 2008 18:09

Hi jeff, maybe a stupid que...

D41d8cd98f00b204e9800998ecf8427e Talk
// ** DO NOT USE **
// THIS IS BAD BROKEN CODE, ONLY DISPLAYED FOR BENCHMARKING PURPOSES!
if (!tagpaired[i] && !ignoredtags.Contains(tagname))
...

C# On Balance HTML Tags

by Jeff Atwood, July 12, 2008 00:46

> Another problem is the co...

51d623f33f8b83095db84ff35e15dbe8 Talk
var ignoredtags = new List<String> { "p", "img", "br" };

if (!tagpaired[i] && !ignoredtags.Contains(tagname))
...

C# On Balance HTML Tags

by Jeff Atwood, July 12, 2008 00:39

> I would think that a list...

51d623f33f8b83095db84ff35e15dbe8 Talk

C# On Balance HTML Tags

by Jeff Atwood, July 12, 2008 00:30

Wow, Corbin, thank you. Tha...

51d623f33f8b83095db84ff35e15dbe8 Talk
public static string BalanceTags(string html)
{
	MatchCollection tags = _namedtags.Matches(html);
...

C# On Balance HTML Tags

by Corbin March, July 11, 2008 21:07 Star_fullStar_fullStar_fullStar_fullStar_full

Is leaving incorrect nestin...

F17131c7feaf9a92fe35323f6ec48429 Talk

C# On Balance HTML Tags

by Peter Hosey, July 11, 2008 11:47

> The simple String.Contain...

63e8a7ad46b1e491d2e8dfd9efc042de Talk

C# On Balance HTML Tags

by Jeff Atwood, July 11, 2008 10:44

> What's wrong with a list ...

51d623f33f8b83095db84ff35e15dbe8 Talk

C# On Sanitize HTML

by Jeff Atwood, July 11, 2008 10:28

> your overall approach is ...

51d623f33f8b83095db84ff35e15dbe8 Talk
HtmlDocument doc = new HtmlDocument();
...

C# On Balance HTML Tags

by Duncan Smart, July 11, 2008 10:06 Star_fullStar_fullStar_full

Example that actually fixes...

13ead10356c893aead42be91b5cdcc01 Talk
if (!tagpaired[i] && !ignoredtags.Contains("<" + tagname))
    continue;

C# On Balance HTML Tags

by Ian Potter, July 11, 2008 10:02

I liked your article on fla...

Ce0162e9224181d6b9eadbe5c629b2ba Talk

C# On Balance HTML Tags

by Duncan Smart, July 11, 2008 09:52

IMHO forget the Regex-ing. ...

13ead10356c893aead42be91b5cdcc01 Talk

C# On Balance HTML Tags

by Peter Hosey, July 11, 2008 09:42

> var ignoredtags = "<p<img...

63e8a7ad46b1e491d2e8dfd9efc042de Talk

C# On Balance HTML Tags

by Jeff Atwood, July 11, 2008 09:25

> p isn't self closing

Wel...

51d623f33f8b83095db84ff35e15dbe8 Talk

C# On Balance HTML Tags

by Konrad, July 11, 2008 08:58

Hi Jeff,

just two quick qu...

F9401202ab73e624cc82800b0fff1489 Talk
public static string AsCommaSeparatedValues<T>(this IEnumerable<T> items, Func<T, string> translator)
{
  return items.Select(translator).AsCommaSeparatedValues();
...

C# On Traversing a List and colle...

by Wolfbyte, July 10, 2008 08:22 Star_fullStar_fullStar_fullStar_fullStar_full

Curses! I wasn't logged in ...

861f311cc4a077c439099d0e5d251e73 Talk
static void Main(string[] args)
{
...

C# On Traversing a List and colle...

by Mike Minutillo, July 10, 2008 05:37 Star_fullStar_fullStar_fullStar_fullStar_full

I'd consider making it more...

861f311cc4a077c439099d0e5d251e73 Talk
using System;
using System.Collections.Generic;
using System.Linq;
...

C# On Traversing a List and colle...

by volothamp, July 09, 2008 07:25 Star_fullStar_fullStar_full
Cd40128e044f39d7063b5cfdeace80f6 Talk

C# On Traversing a List and colle...

by Arjang, July 09, 2008 06:30

LINQ is definitely an optio...

D41d8cd98f00b204e9800998ecf8427e Talk
List<Item> items = new List<Item>();

string descriptions = string.Join(",", items.Select(item => item.Description).ToArray());

C# On Traversing a List and colle...

by Elij, July 09, 2008 05:20 Star_fullStar_fullStar_fullStar_fullStar_full

If linq is an option (.net ...

4d72203c38dd5f3e3d2d446b5888e8a7 Talk
Declare @Name varchar(128)
Declare cCursor Cursor LOCAL FORWARD_ONLY FAST_FORWARD READ_ONLY For Select Name From SysObjects Where XType = 'V'
...

C# On Cache SQL Server Views

by GateKiller, July 07, 2008 11:33

Thanks for the input guys :...

98c852e2d9b26249745ea92c72964d3f Talk

C# On Sanitize HTML

by Mario Pareja, July 05, 2008 15:54

Obviously this method is ve...

024705a643897616a8fa66a3f76d954b Talk

C# On Cache SQL Server Views

by Mark Brackett, July 04, 2008 13:39 Star_fullStar_fullStar_fullStar_full

Your cursor should be LOCAL...

69714938a17318a96a5d4673da8892ec Talk

C# On TableAdapter and CommandTim...

by Auron, July 03, 2008 13:59

You see, I don't find using...

C2953d47b6de83f3217b48c3584fab1c Talk
using System;
using System.Data.SqlClient;
using System.Reflection;
...

C# On TableAdapter and CommandTim...

by volothamp, July 03, 2008 12:21 Star_fullStar_fullStar_fullStar_full

Ok, now I see your point.
...

Cd40128e044f39d7063b5cfdeace80f6 Talk
using System.Data;
...

C# On TableAdapter and CommandTim...

by Auron, July 03, 2008 10:19

Oh, yes, you're right. I di...

C2953d47b6de83f3217b48c3584fab1c Talk