diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-04-10 07:18:06 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-04-10 07:18:06 +0300 |
commit | db1d5e4501d1a222a13a59c4e0bc448177b02f08 (patch) | |
tree | 6ed5e6801f03cafad96bf5f8489395a8ccf2f108 | |
parent | dcfe3205408ee8a23e7821f80bf81070755ceb99 (diff) | |
download | html-page-db1d5e4501d1a222a13a59c4e0bc448177b02f08.tar.gz |
feat: clear an element of its children
Sponsored-by: author
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -475,6 +475,11 @@ impl Element { self.children.push(Content::element(child)); } + /// Remove all children. + pub fn clear_children(&mut self) { + self.children.clear(); + } + /// Append HTML to element. It will NOT be escaped, when the /// element is serialized. pub fn push_html(&mut self, html: &str) { |