Functions
escape_template_syntax_in_html
Escape Jinja2 variable delimiters in already-rendered HTML.
Converts "{{" and "}}" to HTML entitie…
escape_template_syntax_in_html
def escape_template_syntax_in_html(html: str) -> str
Escape Jinja2 variable delimiters in already-rendered HTML.
Converts "{{" and "}}" to HTML entities so they appear literally in documentation pages but won't be detected by tests as unrendered.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
html |
str |
— | HTML content to escape |
Returns
HTML with escaped template syntaxstr
—
escape_jinja_blocks
Escape Jinja2 block delimiters in already-rendered HTML content.
Converts "{%" and "%}" to HTML en…
escape_jinja_blocks
def escape_jinja_blocks(html: str) -> str
Escape Jinja2 block delimiters in already-rendered HTML content.
Converts "{%" and "%}" to HTML entities to avoid leaking raw control-flow markers into final HTML outside template processing.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
html |
str |
— | HTML content to escape |
Returns
HTML with escaped Jinja2 blocksstr
—
transform_internal_links
Transform internal links to include baseurl prefix.
This handles standard markdown links like [tex…
transform_internal_links
def transform_internal_links(html: str, config: dict[str, Any]) -> str
Transform internal links to include baseurl prefix.
This handles standard markdown links like text by prepending the configured baseurl. Essential for GitHub Pages project sites and similar deployments where the site is not at the domain root.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
html |
str |
— | Rendered HTML content |
config |
dict[str, Any] |
— | Site configuration dict |
Returns
HTML with transformed internal linksstr
—