module BBS::Markdown

Markdown to ANSI line array renderer.

BBS::Markdown.to_lines(text, width:, theme:)

Returns an array of strings (one per terminal line) with embedded ANSI SGR codes, suitable for BBS::Widgets::ScrollView. Each inline span ends with the theme :text SGR so that trailing text keeps the right background.

Handled: headings, paragraphs, fenced code blocks, block quotes, bullet and numbered lists, horizontal rules, GFM tables, and inline links, code, bold and italic.