Files
yao-meta-skill/scripts/html_rendering.py
T
wehub-resource-sync 9e1b5784b8
test / test (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-14 10:24:00 +08:00

15 lines
450 B
Python

#!/usr/bin/env python3
"""Shared HTML rendering helpers for static report generators."""
import html
from typing import Any
SCRIPT_INTERFACE = "internal-module"
SCRIPT_INTERFACE_REASON = "Used by report renderers to escape HTML while preserving meaningful falsey values."
def html_text(value: Any) -> str:
"""Escape text for HTML without dropping 0 or False values."""
return html.escape("" if value is None else str(value), quote=True)