This commit is contained in:
Lukas Stancik
2026-04-04 09:40:28 +02:00
commit 5d3afabd24
218 changed files with 82634 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
use markdown::mdast::{Node, Strong, Text};
use mdast_util_to_markdown::{
to_markdown as to, to_markdown_with_options as to_md_with_opts, Options,
};
use pretty_assertions::assert_eq;
#[test]
fn strong() {
assert_eq!(
to(&Node::Strong(Strong {
children: Vec::new(),
position: None
}))
.unwrap(),
"****\n",
"should support an empty strong"
);
assert_eq!(
to(&Node::Strong(Strong {
children: vec![Node::Text(Text {
value: String::from("a"),
position: None,
})],
position: None
}))
.unwrap(),
"**a**\n",
"should support a strong w/ children"
);
assert_eq!(
to_md_with_opts(
&Node::Strong(Strong {
children: vec![Node::Text(Text {
value: String::from("a"),
position: None,
})],
position: None
}),
&Options {
strong: '_',
..Default::default()
}
)
.unwrap(),
"__a__\n",
"should support a strong w/ underscores when `emphasis: \"_\"`"
);
}