My html content is
asdf
Remove the node from parent while keeping the grand children
foreach (var Node in Nodes) { Node.ParentNode.RemoveChild(Node, true); //<-- keepGrandChildren } var newhtml = htmlDocument.DocumentNode.OuterHtml;
output:
asdf Table of Contents