How can I change a tag name in AngleSharp?
问题 Is it possible to change the name of a tag from code? Something like this: var tag = doc.QuerySelector("i"); tag.TagName = "em"; This won't work, because TagName is read-only. But, what are my options for getting to the same end? Would I have to construct an entirely new tag and set the InnerHtml to the contents of the old tag, then delete and swap? Is this even possible? 回答1: If you mean to replace the elements in html string then it can be done this way: private static string