use comrak::ComrakOptions; use mdx_gen::{process_markdown, MarkdownOptions}; #[test] fn test_complex_markdown_with_all_features() { let markdown = r#" # Advanced Markdown Processing Test ## Custom Blocks
This is a note.
This is a warning.
This is a tip.
## Code Blocks with Syntax Highlighting ```rust fn main() { println!("Hello, world!"); } ``` ## Enhanced Tables | Left-aligned | Center-aligned | Right-aligned | |:-------------|:--------------:|---------------:| | A | B | C | | D | E | F | ## Mixed Content Here's a paragraph with **bold** and *italic* text, followed by a list: 1. First item 2. Second item - Subitem 1 - Subitem 2 3. Third item [Link to Rust website](https://www.rust-lang.org/) > This is a blockquote. > It can span multiple lines. --- "#; let options = MarkdownOptions::new() .with_custom_blocks(true) .with_syntax_highlighting(true) .with_enhanced_tables(true) .with_comrak_options({ let mut opts = ComrakOptions::default(); opts.extension.table = true; opts.extension.strikethrough = true; opts.extension.tasklist = true; opts.extension.autolink = true; opts }); let result = process_markdown(markdown, &options); assert!( result.is_ok(), "Markdown processing failed: {:?}", result.err() ); let html = result.unwrap(); // Print the entire HTML output println!("Generated HTML:\n{}", html); // Check for presence of key elements assert!(html.contains("Advanced Markdown Processing Test")); assert!(html.contains(r#"