How pallets/markupsafe works
MarkupSafe is a small Python library for turning text into HTML/XML-safe markup. A caller passes a value to the public API, which escapes ordinary text (or preserves objects implementing __html__) and returns a Markup string. Markup also provides string operations and formatting that escape inserted values, plus unescaping and tag stripping. Escaping uses the optional C accelerator when available and otherwise falls back to the native Python implementation; the excerpts show this selection, but do not establish further runtime components.
Main entry points: __init__.py Markup API · _speedups.c C escaper · _native.py Native escaper
Components 4
Other components
- Library caller
- Markup API
src/markupsafe/__init__.py - C escaper
src/markupsafe/_speedups.c - Native escaper
src/markupsafe/_native.py
Connections 3
- Library caller → Markup API: calls
README.md - Markup API → C escaper: uses if available
src/markupsafe/__init__.py - Markup API → Native escaper: falls back to
src/markupsafe/__init__.py