[][src]Macro typed_html::unsafe_text

macro_rules! unsafe_text {
    ($t:expr) => { ... };
    ($format:tt, $($tail:tt),*) => { ... };
}

Macro for creating unescaped text nodes.

Returns a boxed text node of type Box<UnsafeTextNode>.

This macro is useful for creating text macros inside code blocks that contain HTML that you do not want to be escaped. For example, if some other process renders Markdown to an HTML string and you want embed that HTML string in a typed-html template, you may want to avoid escaping the tags in that HTML string.

Examples

html!(
    <p>{ unsafe_text!("Hello Joe!") }</p>
)
html!(
    <p>{ unsafe_text!("Hello {}!", "Robert") }</p>
)
html!(
    <p>{ unsafe_text!("<div>this text renders unescaped html</div>") }</p>
)