Closed kelko closed 2 years ago
Good point. Yes you are right. 😅
Published a new version on crates.io that fixes this. {Node, HTMLTag}::inner_html
now only returns the markup of the contained elements and {Node, HTMLTag}::outer_html
will now do what Node::inner_html
did before.
The method
pub fn inner_html<'p>(&'p self, parser: &'p Parser<'a>) -> String {
onHTMLTag
states in the documentation that it is equivalent toElement#innerHTML
in browser. Also the name implies this. The referenced MDN page defines innerHTML as:Now the implementation of
inner_html
also serialises the element itself including all the attributes. This seems to me more closely to the definition of Element#outerHTML:I prefer having the outerHTML-equivalent implementation, but maybe the name of the method should be corrected.