1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Telegram rich-message support (Bot API "rich messages", 2026-06).
//!
//! Pipeline: markdown text → [`ast::Block`] AST ([`parse`]) → either Telegram's
//! `InputRichMessage` JSON (rich-first path, finalized against the Bot API
//! field schema) or Telegram HTML ([`render_html`], the fallback path).
//!
//! The AST and parser are deliberately independent of the wire schema, so the
//! markdown front-end and its tests don't churn when the serializer lands, and
//! the same AST drives both the rich and fallback renderers.
//!
//! Files are kept small and single-purpose: [`ast`] (types), [`inline`] /
//! [`table`] / [`list`] / [`parse`] (front-end), [`detect`] (structure gates),
//! [`render_html`] (fallback), [`render_json`] (rich-first serializer, #420
//! path B), [`api`] (raw send), [`mermaid`] (diagram resolution).
//!
//! This file is declarations only — module decls and the public-surface
//! re-exports below. Functions never live in `mod.rs` (CONTRIBUTING.md).
pub
pub
pub
pub
pub
pub
pub
pub
// One import path per name for every caller (`rich::markdown_to_html`,
// `rich::should_send_native_rich`, ...). The re-exports are the module's
// lib-consumed surface — moving a fn into its submodule never touches a
// call site. Test-only consumers import from the source module directly
// (e.g. `rich::detect::has_rich_structure`) so a lib-wide re-export can
// never go unused in the non-test target.
pub use ;
pub use ;
pub use ;
pub use ;