Apply color markup to text. Supported markup: `...` - inline code (rendered with prog_extra color) When colors are disabled, backticks are preserved as-is.
(self, text)
| 526 | return text + '\n\n' |
| 527 | |
| 528 | def _apply_text_markup(self, text): |
| 529 | """Apply color markup to text. |
| 530 | |
| 531 | Supported markup: |
| 532 | `...` - inline code (rendered with prog_extra color) |
| 533 | |
| 534 | When colors are disabled, backticks are preserved as-is. |
| 535 | """ |
| 536 | t = self._theme |
| 537 | if not t.reset: |
| 538 | return text |
| 539 | text = _re.sub( |
| 540 | r'`([^`]+)`', |
| 541 | rf'{t.prog_extra}\1{t.reset}', |
| 542 | text, |
| 543 | ) |
| 544 | return text |
| 545 | |
| 546 | def _format_action(self, action): |
| 547 | # determine the required width and the entry label |