var content = @
1
2
";
var htmlFilter = new HtmlFilter();
htmlFilter.AddHandler("li:nth-child(2n)",
(ctx, nodeInfo) => { nodeInfo.Attributes["style"] = "color:red;"; return true; });
var sw = new StringWriter();
htmlFilter.Execute(new CarteletContext(content, sw), HtmlParser.Parse(content));
sw.ToString();
//
// 1
// 2
//