/// Replaces each element in the set of matched elements with
/// the parsed HTML.
/// It returns the removed elements.
///
/// This follows the same rules as `append`.
Replaces each element in the set of matched elements with
the parsed HTML.
It returns the removed elements.

This follows the same rules as `append`.
Replaces each element in the set of matched elements with the parsed HTML . It returns the removed elements . This follows the same rules as ` append ` .
pub fn replace_with_html<T>(&mut self, html: T)
    where
        T: Into<StrTendril>,
    {
        let dom = parse_html!(html);
        let mut i = 0;
        for node in self.nodes() {
            if i + 1 == self.size() {
                node.append_prev_siblings_from_another_tree(dom.tree);
                break;
            } else {
                node.append_prev_siblings_from_another_tree(dom.tree.clone());
            }
            i += 1;
        }
        self.remove()
    }
pub fn replace_with_html < T > ( & mut self , html : T ) where T : Into < StrTendril > , { let dom = parse_html ! ( html ) ; let mut i = 0 ; for node in self . nodes ( ) { if i + 1 == self . size ( ) { node . append_prev_siblings_from_another_tree ( dom . tree ) ; break ; } else { node . append_prev_siblings_from_another_tree ( dom . tree . clone ( ) ) ; } i += 1 ; } self . remove ( ) }
Replaces each element in the set of matched elements with
the parsed HTML.
Replaces each element in the set of matched elements with the parsed HTML .
&mut self
html
T