twrite_core/batteries/markdown/mod.rs
1//! CommonMark and GitHub Flavored Markdown battery: highlighter and interactive hook.
2//!
3//! The battery is split into focused modules (promoted from a single
4//! `batteries/markdown.rs` once it outgrew one file, per the registry
5//! contract in [`crate::batteries`]):
6//!
7//! - [`config`]: `MarkdownConfig` / `ConcealMode` shared settings.
8//! - [`table`]: GFM pipe-table detection (blocks, pipes, delimiter rows).
9//! - [`highlight`]: `MarkdownHighlighter` (`SyntaxHighlighter` impl).
10//! - [`hook`]: `MarkdownHook` (`EditorHook` impl: shortcuts, lists, tables).
11//! - [`links`]: single-line hyperlink extraction shared by highlighting and
12//! click handling.
13//!
14//! Everything here is built only on the public core API (`SyntaxHighlighter`,
15//! `EditorHook`, `HighlightTag`, `ConcealedLine`, …) and emits only existing
16//! `HighlightTag` variants plus `Custom("markdown.table.*")` names, so no
17//! `twrite-gpui`-side code is required.
18
19mod config;
20mod highlight;
21mod hook;
22mod inline;
23mod links;
24mod table;
25
26pub use config::{ConcealMode, MarkdownConfig};
27pub use highlight::MarkdownHighlighter;
28pub use hook::MarkdownHook;
29pub use links::extract_markdown_links;
30pub use table::{
31 TABLE_CELL_TAG, TABLE_DELIMITER_TAG, TABLE_HEADER_TAG, TableAlignment, TableBlock, TableLayout,
32 TableRowKind, fence_rows, find_unescaped_pipes, is_fenced_row, parse_delimiter_row,
33 split_table_cells, table_block_at, table_block_at_with_fences, table_layouts,
34 table_layouts_with_fences,
35};