MCPcopy Index your code
hub / github.com/python/cpython / _apply_text_markup

Method _apply_text_markup

Lib/argparse.py:528–544  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

_format_textMethod · 0.95

Calls 1

subMethod · 0.45

Tested by

no test coverage detected