package quill
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=96d35ce03dfbebd2313657273e24c2e2d20f9e6c7825b8518b69bd1d6ed5870f
sha512=90c5053731d4108f37c19430e45456063e872b04b8a1bbad064c356e1b18e69222de8bfcf4ec14757e71f18164ec6e4630ba770dbcb1291665de5418827d1465
doc/quill.markdown/Quill_markdown/Edit/index.html
Module Quill_markdown.EditSource
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.
A 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
block_to_html t block renders block to an HTML fragment.
to_html source renders CommonMark source to an HTML fragment.