Content — the canonical content model for Quillmark (issue #831).
One [Content] per content field: a single text sequence carrying line
attributes, anchored marks, and embedded islands, over one coordinate space
of Unicode scalar values. Markdown is demoted to a projection — import
([import::from_markdown]) and export ([export::to_markdown]) codecs — so
every edit is a splice and all structure moves with it.
core, quillmark, and both backends (typst, pdfform) consume this
crate: the seam carries content JSON, storage embeds it structurally (see
prose/canon/DOCUMENT_STORAGE.md), and the content edit surface
(delta, ops) drives per-field splices.
Layout
- [
model] — the [Content] type, the mark set, normalization (the three Spike-A rules), and invariants. The freeze. - [
serial] — canonical, byte-deterministic JSON. One encoding for the seam and for storage. - [
import] — markdown → content (normalize → pulldown → content). - [
export] — content → markdown, per island loss class. - [
delta] — the per-field edit surface: a text-splice change set (retain/insert/delete, CodeMirrorChangeSetsemantics) plus the cold-parse + content-diff stale-text writer with a block-move detector. The text-splice channel is the positional core; mark and line-attribute edits are separate op channels, not op attributes — see [delta]. - [
ops] — mark and line op channels: [Content::apply_text_delta],apply_mark_ops,apply_line_ops. - [
normalize] — the markdown-string input primitive (line endings, bidi strip, HTML-comment fence repair), applied at the import boundary. - [
usv] — USV → UTF-8 byte-offset conversion for slicing the content.