# marker

URL: /patitas/api/parsing/blocks/list/marker/
Section: list
Description: Marker detection utilities for list parsing.

Provides functions for detecting and classifying list markers.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/parsing/blocks/list/marker/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Flist%2Fmarker%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Flist%2Fmarker%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Flist%2Fmarker%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Fparsing%2Fblocks%2Flist%2Fmarker%2Findex.txt)

Module

#
`parsing.blocks.list.marker`

Marker detection utilities for list parsing.

Provides functions for detecting and classifying list markers.

5Functions

## Functions

`get_marker_indent`

1

`int`

▼

Extract indent level from list marker value.

Marker values are prefixed with s…

`def get_marker_indent(marker_value: str) -> int`

Extract indent level from list marker value.

Marker values are prefixed with spaces by the lexer to encode indent.
E.g., " -" has indent 2, "1." has indent 0.

Handles tabs by expanding them to the next multiple of 4 columns.

##### Parameters

Name
Type
Description

`marker_value`
`str`

The raw marker value from the token

##### Returns

`int`

`extract_marker_info`

2

`ListMarkerInfo (/patitas/api/parsing/blocks/list/types/#ListMarkerInfo)`

▼

Extract complete marker information from a marker token value.

`def extract_marker_info(marker_value: str, start_indent: int | None = None) -> ListMarkerInfo`

##### Parameters

Name
Type
Description

`marker_value`
`str`

The raw marker value from the token

`start_indent`
`int | None`

Override indent calculation (optional)

Default:`None`

##### Returns

`ListMarkerInfo (/patitas/api/parsing/blocks/list/types/#ListMarkerInfo)`

`is_list_marker`

1

`bool`

▼

Check if text starts with a list marker pattern.

`def is_list_marker(text: str) -> bool`

##### Parameters

Name
Type
Description

`text`
`str`

Text to check (should be stripped of leading whitespace)

##### Returns

`bool`

`is_same_list_type`

4

`bool`

▼

Check if a marker belongs to the same list type.

**CommonMark requires same li…

`def is_same_list_type(marker_value: str, ordered: bool, bullet_char: str, ordered_marker_char: str) -> bool`

Check if a marker belongs to the same list type.

CommonMark requires same list type and marker character:

- Unordered: -, *, + are different lists

- Ordered: . and ) are different lists

##### Parameters

Name
Type
Description

`marker_value`
`str`

The raw marker value from the token

`ordered`
`bool`

Whether the current list is ordered

`bullet_char`
`str`

Current list's bullet character (for unordered)

`ordered_marker_char`
`str`

Current list's marker character (for ordered)

##### Returns

`bool`

`extract_task_marker`

1

`tuple[bool | None, str]`

▼

Extract task list marker from line content.

`def extract_task_marker(line: str) -> tuple[bool | None, str]`

##### Parameters

Name
Type
Description

`line`
`str`

The line content (stripped of marker)

##### Returns

`tuple[bool | None, str]`
