Module

parsing.blocks.list.types

Type definitions for list parsing.

Provides dataclasses and type aliases for list parsing state management.

Classes

ListMarkerInfo 6
Information extracted from a list marker.

Information extracted from a list marker.

Attributes

Name Type Description
ordered bool

Whether this is an ordered list (1. vs -)

bullet_char str

For unordered lists, the bullet character (-, *, +)

ordered_marker_char str

For ordered lists, the marker character (. or ))

start int

Starting number for ordered lists

indent int

Indent level of the marker

marker_length int

Length of the marker including trailing space

ListItemState 5
State for parsing a single list item. Tracks content accumulation, child blocks, and task list sta…

State for parsing a single list item.

Tracks content accumulation, child blocks, and task list status.

Attributes

Name Type Description
children list[Block]
content_lines list[str]
checked bool | None
actual_content_indent int | None
saw_paragraph_content bool
ListParsingContext 6
Context for list parsing operations. Encapsulates the parsing state needed by helper functions wit…

Context for list parsing operations.

Encapsulates the parsing state needed by helper functions without exposing the full parser interface.

Attributes

Name Type Description
source str

The full source text being parsed

start_indent int

Indent level of the list's first marker

content_indent int

Minimum indent for continuation content

bullet_char str

Bullet character for unordered lists

ordered_marker_char str

Marker character (. or )) for ordered lists

ordered bool

Whether this is an ordered list

ContinueAction 0
Sentinel for continuing the parsing loop.

Sentinel for continuing the parsing loop.

BreakAction 0
Sentinel for breaking out of the parsing loop.

Sentinel for breaking out of the parsing loop.

ContentAction 1
Action to add content to the current item.

Action to add content to the current item.

Attributes

Name Type Description
content str
BlockAction 1
Action to add a block to the current item's children.

Action to add a block to the current item's children.

Attributes

Name Type Description
block Block
NestedListAction 0
Action indicating a nested list should be parsed.

Action indicating a nested list should be parsed.

LooseListAction 0
Action to mark the list as loose (has blank lines between items).

Action to mark the list as loose (has blank lines between items).