Function sauron::prelude::safe_html [−]
pub fn safe_html<S, NS, TAG, ATT, VAL>(s: S) -> Node<NS, TAG, ATT, VAL> where
S: ToString,
NS: PartialEq<NS> + Clone + Debug,
TAG: PartialEq<TAG> + Clone + Debug,
ATT: PartialEq<ATT> + Clone + Debug,
VAL: PartialEq<VAL> + Clone + Debug,
Expand description
Create an html and instruct the DOM renderer and/or DOM patcher that the operation is safe.
Note: this operation doesn’t sanitize the html code. It is your responsibility as a programmer to sanitize the input here.
Example
use mt_dom::{Node,safe_html};
let html: Node<&'static str, &'static str, &'static str, &'static str> =
safe_html("This contains safe html and it's solid   should work correctly");