aboutsummaryrefslogtreecommitdiffstats
path: root/tests/html_flow.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 15:57:55 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-06 15:57:55 +0200
commitcd5bb2d16c6b28332b0b6077b27b2b90a8051896 (patch)
tree848ebc6200b80d2dfdcd67bf0bb245eea06bb24f /tests/html_flow.rs
parent6e80e03bb6d6af47aba2b339f160e4895ab5afba (diff)
downloadmarkdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.gz
markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.tar.bz2
markdown-rs-cd5bb2d16c6b28332b0b6077b27b2b90a8051896.zip
Refactor to split parse from compile options
Diffstat (limited to 'tests/html_flow.rs')
-rw-r--r--tests/html_flow.rs61
1 files changed, 48 insertions, 13 deletions
diff --git a/tests/html_flow.rs b/tests/html_flow.rs
index 2f1d85f..ca93510 100644
--- a/tests/html_flow.rs
+++ b/tests/html_flow.rs
@@ -3,14 +3,18 @@ use micromark::{
mdast::{Html, Node, Root},
micromark, micromark_to_mdast, micromark_with_options,
unist::Position,
- Constructs, Options,
+ CompileOptions, Constructs, Options, ParseOptions,
};
use pretty_assertions::assert_eq;
#[test]
fn html_flow() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -30,9 +34,12 @@ fn html_flow() -> Result<(), String> {
micromark_with_options(
"<x>",
&Options {
- constructs: Constructs {
- html_flow: false,
- ..Constructs::default()
+ parse: ParseOptions {
+ constructs: Constructs {
+ html_flow: false,
+ ..Constructs::default()
+ },
+ ..ParseOptions::default()
},
..Options::default()
}
@@ -42,7 +49,7 @@ fn html_flow() -> Result<(), String> {
);
assert_eq!(
- micromark_to_mdast("<div>\nstuff\n</div>", &Options::default())?,
+ micromark_to_mdast("<div>\nstuff\n</div>", &ParseOptions::default())?,
Node::Root(Root {
children: vec![Node::Html(Html {
value: "<div>\nstuff\n</div>".to_string(),
@@ -59,7 +66,11 @@ fn html_flow() -> Result<(), String> {
#[test]
fn html_flow_1_raw() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -221,7 +232,11 @@ p {color:blue;}
#[test]
fn html_flow_2_comment() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -326,7 +341,11 @@ fn html_flow_2_comment() -> Result<(), String> {
#[test]
fn html_flow_3_instruction() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -379,7 +398,11 @@ fn html_flow_3_instruction() -> Result<(), String> {
#[test]
fn html_flow_4_declaration() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -440,7 +463,11 @@ fn html_flow_4_declaration() -> Result<(), String> {
#[test]
fn html_flow_5_cdata() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -510,7 +537,11 @@ fn html_flow_5_cdata() -> Result<(), String> {
#[test]
fn html_flow_6_basic() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};
@@ -793,7 +824,11 @@ okay.",
#[test]
fn html_flow_7_complete() -> Result<(), String> {
let danger = Options {
- allow_dangerous_html: true,
+ compile: CompileOptions {
+ allow_dangerous_html: true,
+ allow_dangerous_protocol: true,
+ ..CompileOptions::default()
+ },
..Options::default()
};