blob: 55597743cb54aecaa079b01362ac8b9cdf030ccf (
plain) (
tree)
|
|
extern crate micromark;
use micromark::{micromark, micromark_with_options, Options};
#[test]
fn dangerous_html() {
let danger = &Options {
allow_dangerous_html: true,
allow_dangerous_protocol: true,
..Options::default()
};
assert_eq!(
micromark("<x>"),
"<x>",
"should be safe by default for flow"
);
assert_eq!(
micromark("a<b>"),
"<p>a<b></p>",
"should be safe by default for text"
);
assert_eq!(
micromark_with_options("<x>", danger),
"<x>",
"should be unsafe w/ `allowDangerousHtml`"
);
}
|