markstream_core library
Markdown syntax and source coordinates without Flutter dependencies.
Classes
-
AstVisitor<
T> - BlockNode
- BlockParser
- Builds block structure before inline interpretation, using original offsets.
- BlockQuoteNode
- BlockSyntax
- Classifies a scanned leaf block without changing its structural source boundary. Use the built-in directive or fence grammar for custom multiline containers. Returning null leaves the block available to the next registered syntax.
- BlockSyntaxContext
- CodeBlockNode
- CodeSpanNode
- DetailsNode
- DetailsSummaryNode
- DirectiveLabelNode
- DocumentNode
- EmphasisNode
- HeadingNode
- HighlightNode
- HtmlBlockNode
- HtmlElementNode
- ImageNode
- IncrementalDocument
- Reuses complete leading blocks and reparses the final open block chain.
- InlineNode
- InlineParser
- Parses inline syntax with delimiter and bracket stacks, without source edits.
- InlineSyntax
- A pure Dart extension. It is never invoked inside code or math bodies.
- InlineSyntaxContext
- InlineSyntaxMatch
- LineBreakNode
- LinkNode
- ListItemNode
- ListNode
- MarkdownNode
- Immutable syntax with offsets into the caller's unmodified source.
- MarkdownParser
- Two-phase block and inline parsing. References resolve across the document.
- MarkdownStructure
- Source structure shared by speech, paragraph splitting and attachment scans. Uses the renderer's block parser, including open streaming containers, so consumers do not maintain a second fence, math or details grammar.
- MathBlockNode
- MathInlineNode
- NamedBlockNode
- NamedInlineNode
- ParagraphNode
- ParserOptions
- Independently configurable Markdown syntax, defaulting to the LLM dialect.
- RecursiveAstVisitor
- Override specific visits and call super to keep walking their descendants.
- ReferenceDefinitionNode
- SourceLine
- One physical source line; line endings are retained in source coordinates.
- SourceSpan
- A half-open interval of UTF-16 code-unit offsets in the original source.
- StreamingOptions
- Closure policy for an incomplete document; complete input keeps its syntax.
- StrikethroughNode
- TableCellNode
- TableNode
- TableRowNode
- TaskItemNode
- TextIndex
- Maps selectable UTF-16 offsets to original source, independently of TSV, list markers and paragraph separators generated for clipboard text.
- TextIndexEntry
- TextNode
- TextSegment
- One rendered/selectable fragment. Generated glyphs use an empty source span.
- ThematicBreakNode
Functions
-
escapeHtml(
String value) → String -
isSafeHtmlUrl(
String value, {bool image = false}) → bool -
normalizeReferenceLabel(
String label) → String -
removeCode(
String source) → String - Removes fenced code and closed inline-code spans for speech while keeping surrounding Markdown and original line endings. Inline code is deliberately line-local: an unmatched backtick in one speech line cannot hide later prose. An unfinished fence, however, suppresses its complete remaining body.
-
tableToCsv(
TableNode table) → String -
toHtml(
MarkdownNode root) → String - Portable HTML for export and clipboard use; active tags and URL schemes are excluded.
-
toMarkdown(
MarkdownNode root, {String? source}) → String -
Canonical Markdown.
sourcepreserves app-specific extension spellings. -
toPlainText(
MarkdownNode root) → String - Structural clipboard text. Generated separators do not define selection offsets.