MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / escape_cdata

Function escape_cdata

markdown/extensions/toc.py:119–128  ·  view source on GitHub ↗

Escape character data.

(text: str)

Source from the content-addressed store, hash-verified

117
118
119def escape_cdata(text: str) -> str:
120 """ Escape character data. """
121 if "&" in text:
122 # Only replace & when not part of an entity
123 text = RE_AMP.sub('&', text)
124 if "<" in text:
125 text = text.replace("<", "&lt;")
126 if ">" in text:
127 text = text.replace(">", "&gt;")
128 return text
129
130
131def run_postprocessors(text: str, md: Markdown) -> str:

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…