Functions
can_use_token_reuse
2
bool
▼
Check if block quote can use token reuse optimization.
**Criteria:**
1. Conten…
can_use_token_reuse
2
bool
▼
def can_use_token_reuse(tokens: list, start_pos: int) -> bool
Check if block quote can use token reuse optimization.
Criteria:
- Content is simple paragraphs only (no code blocks, lists, etc.)
- No lazy continuation (every content line follows a BLOCK_QUOTE_MARKER)
- No nested block quotes (>> pattern)
Parameters
| Name | Type | Description |
|---|---|---|
tokens |
list |
Full token list |
start_pos |
int |
Position of first BLOCK_QUOTE_MARKER |
Returns
bool
parse_blockquote_with_token_reuse
3
tuple[BlockQuote, int]
▼
Parse block quote by reusing existing tokens.
PRECONDITION: can_use_token_reus…
parse_blockquote_with_token_reuse
3
tuple[BlockQuote, int]
▼
def parse_blockquote_with_token_reuse(tokens: list, start_pos: int, parse_inline_fn: Callable[[str, SourceLocation], tuple[Inline, ...]]) -> tuple[BlockQuote, int]
Parse block quote by reusing existing tokens.
PRECONDITION: can_use_token_reuse(tokens, start_pos) returned True.
Parameters
| Name | Type | Description |
|---|---|---|
tokens |
list |
Full token list |
start_pos |
int |
Position of first BLOCK_QUOTE_MARKER |
parse_inline_fn |
Callable[[str, SourceLocation], tuple[Inline, ...]] |
Function to parse inline content |
Returns
tuple[BlockQuote, int]
_is_complex_blockquote_content
1
bool
▼
Check if content requires full sub-parser.
_is_complex_blockquote_content
1
bool
▼
def _is_complex_blockquote_content(content: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
content |
str |
Returns
bool