CsQuery
CsQuery copied to clipboard
Selector doesn't work correctly with same elements next to each other
CsQuery.CQ test = "<p><em>Hello</em><em>World</em></p>";
test.Select("em").Before("{EM_BEFORE}");
test.Select("em").After("{EM_AFTER}");
test.Remove("em");
var test2 = test.Text().Replace("{EM_BEFORE}", "<em>").Replace("{EM_AFTER}", "</em>");
Gets rid of one of the closing </em>
s, outputting:
<em>Hello<em>World</em>
jQuery handles this correctly.