Escape character data.
(text: str)
| 117 | |
| 118 | |
| 119 | def 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("<", "<") |
| 126 | if ">" in text: |
| 127 | text = text.replace(">", ">") |
| 128 | return text |
| 129 | |
| 130 | |
| 131 | def run_postprocessors(text: str, md: Markdown) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…