aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc_dangerous_html.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 16:31:14 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 16:31:14 +0200
commit5403261e8213f68633a09fc3e9bc2e6e2cd777b2 (patch)
treebb3a6419ef42f7611c2cb24fe7024228f579331b /tests/misc_dangerous_html.rs
parent03544cafaa82ba4bd7e0bc3372fc59549a8dc0cc (diff)
downloadmarkdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.tar.gz
markdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.tar.bz2
markdown-rs-5403261e8213f68633a09fc3e9bc2e6e2cd777b2.zip
Add support for turning off constructs
Diffstat (limited to 'tests/misc_dangerous_html.rs')
-rw-r--r--tests/misc_dangerous_html.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/misc_dangerous_html.rs b/tests/misc_dangerous_html.rs
index 76031c1..5559774 100644
--- a/tests/misc_dangerous_html.rs
+++ b/tests/misc_dangerous_html.rs
@@ -1,14 +1,14 @@
extern crate micromark;
use micromark::{micromark, micromark_with_options, Options};
-const DANGER: &Options = &Options {
- allow_dangerous_html: true,
- allow_dangerous_protocol: true,
- default_line_ending: None,
-};
-
#[test]
fn dangerous_html() {
+ let danger = &Options {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..Options::default()
+ };
+
assert_eq!(
micromark("<x>"),
"&lt;x&gt;",
@@ -22,7 +22,7 @@ fn dangerous_html() {
);
assert_eq!(
- micromark_with_options("<x>", DANGER),
+ micromark_with_options("<x>", danger),
"<x>",
"should be unsafe w/ `allowDangerousHtml`"
);