ContentParser class

Converts a novident_editor_document Document into the AST content model.

This is the structural “agnostic parser”: every editor block is mapped to its AST equivalent preserving the tree — lists (including nested lists), tables, images — instead of flattening everything into paragraphs.

Block mapping:

  • paragraph, heading, quote, todo_listParagraph (kind carried in metadata; heading keeps level, todo_list keeps checked).
  • bulleted_list / numbered_list / todo_listListItem with its own text paragraph and nested items as children.
  • imageImage.
  • tableTable (List<List<Content>>, cell contents parsed recursively).
  • dividerDivider.
  • columnsColumns with one Column per editor column child.

Non-text leaf blocks without an AST equivalent are traversed so their text is not lost, with the block type kept in metadata.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parseDocument(Document document) List<Content<Object?>>
Parses the whole document into AST content (pre-order).
parseNode(Node node, {int indent = 0}) List<Content<Object?>>
Parses node and its descendants into a list of AST content.