Classes
MarkdownRenderer
2
▼
Render Markdown source to HTML via patitas.
Wraps ``patitas.Markdown`` with a stable interface tha…
MarkdownRenderer
2
▼
Render Markdown source to HTML via patitas.
Wrapspatitas.Markdownwith a stable interface that chirp
controls. Phase 1 does a full parse+render on every call.
Incremental parsing can be layered in later behindrender().
Methods
render
1
Markup
▼
Render Markdown source to an HTML string.
Returns sanitized ``Markup`` so kida…
render
1
Markup
▼
def render(self, source: str) -> Markup
Render Markdown source to an HTML string.
Returns sanitizedMarkupso kida's auto-escaping preserves
Markdown-generated HTML when the renderer is used as a template
filter. Passsanitize=Falseonly for trusted content.
Parameters
| Name | Type | Description |
|---|---|---|
source |
— |
Raw Markdown text. |
Returns
Markup
Rendered HTML wrapped in ``Markup``.
Internal Methods 1 ▼
__init__
3
▼
__init__
3
▼
def __init__(self, *, plugins: list[str] | None = None, highlight: bool = True, sanitize: bool = True) -> None
Parameters
| Name | Type | Description |
|---|---|---|
plugins |
— |
Default:None
|
highlight |
— |
Default:True
|
sanitize |
— |
Default:True
|
_MarkdownHTMLSanitizer
8
▼
_MarkdownHTMLSanitizer
8
▼
Methods
html
0
str
▼
property
html
0
str
▼
def html(self) -> str
Returns
str
handle_starttag
2
▼
handle_starttag
2
▼
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
Parameters
| Name | Type | Description |
|---|---|---|
tag |
— |
|
attrs |
— |
handle_startendtag
2
▼
handle_startendtag
2
▼
def handle_startendtag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
Parameters
| Name | Type | Description |
|---|---|---|
tag |
— |
|
attrs |
— |
handle_endtag
1
▼
handle_endtag
1
▼
def handle_endtag(self, tag: str) -> None
Parameters
| Name | Type | Description |
|---|---|---|
tag |
— |
handle_data
1
▼
handle_data
1
▼
def handle_data(self, data: str) -> None
Parameters
| Name | Type | Description |
|---|---|---|
data |
— |
handle_entityref
1
▼
handle_entityref
1
▼
def handle_entityref(self, name: str) -> None
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
handle_charref
1
▼
handle_charref
1
▼
def handle_charref(self, name: str) -> None
Parameters
| Name | Type | Description |
|---|---|---|
name |
— |
Internal Methods 1 ▼
__init__
0
▼
__init__
0
▼
def __init__(self) -> None
Functions
_get_markdown
2
Markdown
▼
Create a patitas Markdown instance, raising a clear error if missing.
_get_markdown
2
Markdown
▼
def _get_markdown(*, plugins: list[str] | None, highlight: bool) -> Markdown
Parameters
| Name | Type | Description |
|---|---|---|
plugins |
list[str] | None |
|
highlight |
bool |
Returns
Markdown