Functions
extract_text
2
str
▼
Extract plain text from any AST node.
Recursively walks the tree, concatenatin…
extract_text
2
str
▼
def extract_text(node: Node, *, source: str = '') -> str
Extract plain text from any AST node.
Recursively walks the tree, concatenating text content. Skips HtmlBlock, HtmlInline. LineBreak and SoftBreak contribute a space.
Parameters
| Name | Type | Description |
|---|---|---|
node |
Node |
Any AST node (block or inline). |
source |
str |
Original source string (required for FencedCode zero-copy extraction; use empty string if unavailable). Default:''
|
Returns
str