Rudimentary attempt to escape special RST characters to appear as plain text.
(text: str)
| 36 | |
| 37 | |
| 38 | def escape_rst(text: str) -> str: |
| 39 | """Rudimentary attempt to escape special RST characters to appear as |
| 40 | plain text.""" |
| 41 | text = ( |
| 42 | text.replace("*", "\\*") |
| 43 | .replace("<", "\\<") |
| 44 | .replace(">", "\\>") |
| 45 | .replace("`", "\\`") |
| 46 | ) |
| 47 | text = re.sub(r"_\b", "", text) |
| 48 | return text |
| 49 | |
| 50 | |
| 51 | def iter_plugins(): |