Module Quill_markdown.Edit
Typora-style cursor-aware markdown block segmentation.
Parses a markdown source string into top-level blocks with byte ranges. Consumers use this to render inactive blocks formatted and the active block (containing the cursor) as raw text for editing.
Types
#
type span = {- #
first : int;(*Inclusive start byte offset in source (zero-based).
*) - #
last : int;(*Inclusive end byte offset in source (zero-based).
*)
}A byte range within the source string.
A top-level block extracted from a markdown source string.
#
type tA parsed markdown source split into blocks with byte ranges.
Parsing
Queries
active_block t ~cursor is the block containing byte offset cursor, or None if cursor is outside all blocks.
block_source t block extracts the raw source substring for block.
Rendering
#
val to_html : string -> stringto_html source renders CommonMark source to an HTML fragment.