CsQuery icon indicating copy to clipboard operation
CsQuery copied to clipboard

Selector doesn't work correctly with same elements next to each other

Open tariqporter opened this issue 9 years ago • 0 comments

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.

tariqporter avatar Jul 16 '15 23:07 tariqporter