// Input rule matching logic ported from
// `packages/plugin/src/defaults/inputRules.ts`. Keeping pattern/tactic
// equivalence with the TS side matters more than pedantic Rust style,
// so a handful of lints that fire on the idiomatic mirror are allowed.
//
// Justifications:
// - `module_name_repetitions`: public API uses names like `MarkdownMatch`
//   in module `markdown.rs` — the repetition aids discoverability.
// - `too_many_lines`: the `shortcuts()` table has ~90 lines of rule
//   declarations. Splitting across helpers would obscure the 1:1
//   mapping with the TS `MARKDOWN_SHORTCUTS` array.
// - `doc_markdown`: prose references to "Process" key events, Notion
//   etc. trigger false positives for missing code fences.
#![allow(
    clippy::module_name_repetitions,
    clippy::too_many_lines,
    clippy::doc_markdown
)]

//! Markdown shortcut, special-character, and inline-mark matchers for
//! the devup editor input-rule pipeline.
//!
//! Every matcher is a pure function of `(block_text, cursor_offset)`:
//! no DOM, no editor handle, no commands. The React layer calls into
//! these matchers, inspects the returned [`Match`] payload, and
//! synthesises the appropriate `dispatchBatch` sequence on the JS
//! side. This keeps command dispatch (which needs an `EditorHandle`)
//! in React and confines the hot-path string work to Rust.
//!
//! The regex patterns, delimiter rules, and skip-`~~` reservation are
//! mirrored byte-for-byte from the TypeScript source so behaviour is
//! identical under typical clipboard / keyboard interactions.

mod mark;
mod markdown;
mod special_char;

pub use mark::{InlineMatch, LinkMatch, MarkKind, match_inline_mark};
pub use markdown::{MarkdownMatch, match_markdown_shortcut};
pub use special_char::{SpecialCharMatch, match_special_char};
