Classes
ListClassifierMixin
4
▼
Mixin providing list marker classification.
ListClassifierMixin
4
▼
Mixin providing list marker classification.
Methods
Internal Methods 4 ▼
_make_token
6
Token
▼
Create token with raw coordinates. Implemented by Lexer.
_make_token
6
Token
▼
def _make_token(self, token_type: TokenType, value: str, start_pos: int, *, start_col: int | None = None, end_pos: int | None = None, line_indent: int = -1) -> Token
Parameters
| Name | Type | Description |
|---|---|---|
token_type |
— |
|
value |
— |
|
start_pos |
— |
|
start_col |
— |
Default:None
|
end_pos |
— |
Default:None
|
line_indent |
— |
Default:-1
|
Returns
Token
_calc_indent
1
tuple[int, int]
▼
Calculate indent level. Implemented by Lexer.
_calc_indent
1
tuple[int, int]
▼
def _calc_indent(self, line: str) -> tuple[int, int]
Parameters
| Name | Type | Description |
|---|---|---|
line |
— |
Returns
tuple[int, int]
_try_classify_list_marker
3
Iterator[Token] | None
▼
Try to classify content as list item marker.
_try_classify_list_marker
3
Iterator[Token] | None
▼
def _try_classify_list_marker(self, content: str, line_start: int, indent: int = 0) -> Iterator[Token] | None
Parameters
| Name | Type | Description |
|---|---|---|
content |
— |
|
line_start |
— |
|
indent |
— |
Default:0
|
Returns
Iterator[Token] | None
_yield_list_marker_and_content
4
Iterator[Token]
▼
Yield list marker token and optional content tokens.
Content after the marker …
_yield_list_marker_and_content
4
Iterator[Token]
▼
def _yield_list_marker_and_content(self, marker: str, remaining: str, line_start: int, indent: int = 0) -> Iterator[Token]
Yield list marker token and optional content tokens.
Content after the marker is checked for block-level elements:
- Thematic breaks (* * *, - - -, etc.)
- Fenced code blocks
- Block quotes
- ATX headings
- Nested list markers
Parameters
| Name | Type | Description |
|---|---|---|
marker |
— |
|
remaining |
— |
|
line_start |
— |
|
indent |
— |
Default:0
|
Returns
Iterator[Token]