(self, text: str)
| 2485 | # text handling |
| 2486 | |
| 2487 | def encode(self, text: str) -> str: |
| 2488 | text = self.escape(text) |
| 2489 | if self.literal_whitespace: |
| 2490 | # Insert a blank before the newline, to avoid |
| 2491 | # ! LaTeX Error: There's no line here to end. |
| 2492 | text = text.replace(CR, r'~\\' + CR).replace(' ', '~') |
| 2493 | return text |
| 2494 | |
| 2495 | def encode_uri(self, text: str) -> str: |
| 2496 | # TODO: it is probably wrong that this uses texescape.escape() |