pub fn apply_whitelist(html_str: String, convert_image_flag: bool) -> String {
    let opts = ParseOpts {
        tree_builder: TreeBuilderOpts {
            drop_doctype: true,
            ..Default::default()
        },
        ..Default::default()
    };

    // DOM like
    // <html><head></head><body>{contents}</body></html>
    let parsed_dom = parse_document(RcDom::default(), opts).one(html_str);

    let parsed_dom = &parsed_dom.document; // document
    let parsed_dom = &parsed_dom.children.borrow()[0]; // html
    let parsed_dom = &parsed_dom.children.borrow()[1]; // body

    let mut doc = RcDom::default();
    let root = doc.document.clone();

    sanitize(&mut doc, parsed_dom, &root, convert_image_flag);

    let mut bytes = vec![];
    let ser: SerializableHandle = doc.document.into();
    serialize(&mut bytes, &ser, Default::default()).expect("Error occured in serializing");
    String::from_utf8(bytes).unwrap()
}
/// accept tags and attributes in WHITELIST
///
/// # e.g.
/// `<div style="...">text</div>` => `<div>text</div>`  
/// `<blink><p>text</p></blink>` => `<p>text</p>`
accept tags and attributes in WHITELIST
accept tags and attributes in WHITELIST
pub fn apply_whitelist(html_str: String, convert_image_flag: bool) -> String {
    let opts = ParseOpts {
        tree_builder: TreeBuilderOpts {
            drop_doctype: true,
            ..Default::default()
        },
        ..Default::default()
    };
    // DOM like
    // <html><head></head><body>{contents}</body></html>
    let parsed_dom = parse_document(RcDom::default(), opts).one(html_str);
    let parsed_dom = &parsed_dom.document; // document
    let parsed_dom = &parsed_dom.children.borrow()[0]; // html
    let parsed_dom = &parsed_dom.children.borrow()[1]; // body
    let mut doc = RcDom::default();
    let root = doc.document.clone();
    sanitize(&mut doc, parsed_dom, &root, convert_image_flag);
    let mut bytes = vec![];
    let ser: SerializableHandle = doc.document.into();
    serialize(&mut bytes, &ser, Default::default()).expect("Error occured in serializing");
    String::from_utf8(bytes).unwrap()
}
pub fn apply_whitelist ( html_str : String , convert_image_flag : bool ) -> String { let opts = ParseOpts { tree_builder : TreeBuilderOpts { drop_doctype : true , .. Default :: default ( ) } , .. Default :: default ( ) } ; // DOM like // <html><head></head><body>{contents}</body></html> let parsed_dom = parse_document ( RcDom :: default ( ) , opts ) . one ( html_str ) ; let parsed_dom = & parsed_dom . document ; // document let parsed_dom = & parsed_dom . children . borrow ( ) [ 0 ] ; // html let parsed_dom = & parsed_dom . children . borrow ( ) [ 1 ] ; // body let mut doc = RcDom :: default ( ) ; let root = doc . document . clone ( ) ; sanitize ( & mut doc , parsed_dom , & root , convert_image_flag ) ; let mut bytes = vec ! [ ] ; let ser : SerializableHandle = doc . document . into ( ) ; serialize ( & mut bytes , & ser , Default :: default ( ) ) . expect ( " " ) ; String :: from_utf8 ( bytes ) . unwrap ( ) }
accept tags and attributes in WHITELIST
accept tags and attributes in WHITELIST
html_str
String
convert_image_flag
bool
e.g.
None