MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / code_escape

Function code_escape

markdown/util.py:155–163  ·  view source on GitHub ↗

HTML escape a string of code.

(text: str)

Source from the content-addressed store, hash-verified

153
154
155def code_escape(text: str) -> str:
156 """HTML escape a string of code."""
157 if "&" in text:
158 text = text.replace("&", "&")
159 if "<" in text:
160 text = text.replace("<", "&lt;")
161 if ">" in text:
162 text = text.replace(">", "&gt;")
163 return text
164
165
166def _get_stack_depth(size: int = 2) -> int:

Callers 1

py_renderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected