HTML escape a string of code.
(text: str)
| 156 | |
| 157 | |
| 158 | def code_escape(text: str) -> str: |
| 159 | """HTML escape a string of code.""" |
| 160 | if "&" in text: |
| 161 | text = text.replace("&", "&") |
| 162 | if "<" in text: |
| 163 | text = text.replace("<", "<") |
| 164 | if ">" in text: |
| 165 | text = text.replace(">", ">") |
| 166 | return text |
| 167 | |
| 168 | |
| 169 | def _get_stack_depth(size: int = 2) -> int: |
nothing calls this directly
no outgoing calls
no test coverage detected