use super::elements::render;
use super::parser::render_markdown_to_elements;
use crate::widgets::markdown_widget::extensions::theme::MarkdownStyle;
pub fn render_markdown(markdown: &str, max_width: Option<usize>) -> ratatui::text::Text<'static> {
let width = max_width.unwrap_or(120);
let elements = render_markdown_to_elements(markdown, true);
let mut lines = Vec::new();
for element in elements {
lines.extend(render(&element, width));
}
ratatui::text::Text::from(lines)
}
pub fn render_markdown_with_style(
markdown: &str,
_style: MarkdownStyle,
max_width: Option<usize>,
) -> ratatui::text::Text<'static> {
render_markdown(markdown, max_width)
}