Skip to main content

Module markdown_input

Module markdown_input 

Expand description

Markdown typed as formatting.

An editor that formats as the person types (the notes BlockEditor) turns **bold** into bold text the moment the closing delimiter is typed. Whether a keystroke completes such a span is the same decision in every editor; only how the result is shown differs. This module makes that decision: it is pure, knows nothing of rendering or documents, and returns byte ranges with a neutral InlineKind that each editor maps onto its own formatting.

detect_inline recognises **b**/__b__ (bold), *i*/_i_ (italic), `c` (code), ~~s~~ (strikethrough) and [text](url) (a link), fired by the keystroke that types the closing delimiter, and a web address followed by a space (an autolink).

Structs§

InlineMatch
A span completed by the last character of the text before the caret.

Enums§

InlineKind
The formatting a completed span asks for.

Functions§

detect_inline
The span the last character of before_caret completes, if any.