use mdx_gen::{process_markdown, MarkdownOptions};
#[test]
fn test_basic_markdown_conversion() {
let markdown = "# Hello, world!";
let options = MarkdownOptions::new()
.with_enhanced_tables(false) // Disable enhanced tables for this test
.with_comrak_options({
let mut opts = comrak::ComrakOptions::default();
opts.extension.table = false; // Ensure the table extension is disabled
opts
});
let result = process_markdown(markdown, &options).unwrap();
assert_eq!(result.trim(), "
Hello, world!
");
}
#[test]
fn test_markdown_with_extensions() {
let markdown = "This is a ~~strikethrough~~ test.";
let options = MarkdownOptions::new()
.with_enhanced_tables(false) // Disable enhanced tables for this test
.with_comrak_options({
let mut opts = comrak::ComrakOptions::default();
opts.extension.strikethrough = true; // Enable strikethrough
opts.extension.table = false; // Disable the table extension
opts
});
let result = process_markdown(markdown, &options).unwrap();
assert_eq!(
result.trim(),
"This is a strikethrough test.
"
);
}
#[test]
fn test_markdown_with_links() {
let markdown = "[MDX Generator](https://mdxgen.com/)";
let options = MarkdownOptions::new()
.with_enhanced_tables(false) // Disable enhanced tables for this test
.with_comrak_options({
let mut opts = comrak::ComrakOptions::default();
opts.extension.table = false; // Disable the table extension
opts
});
let result = process_markdown(markdown, &options).unwrap();
assert_eq!(
result.trim(),
r#"MDX Generator
"#
);
}