This is a development version (9.14.0.dev) and may be unstable. Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.14.0.dev / IPython / utils / text / strip_email_quotes

function

IPython.utils.text:strip_email_quotes

source: /IPython/utils/text.py :379

Signature

def   strip_email_quotes ( text : str )  →  str

Summary

Strip leading email quotation characters ('>').

Extended Summary

Removes any combination of leading '>' interspersed with whitespace that appears identically in all lines of the input text.

Parameters

text : str

Examples

Simple uses:: In [2]: strip_email_quotes('> > text') Out[2]: 'text' In [3]: strip_email_quotes('> > text\n> > more') Out[3]: 'text\nmore' Note how only the common prefix that appears in all lines is stripped:: In [4]: strip_email_quotes('> > text\n> > more\n> more...') Out[4]: '> text\n> more\nmore...' So if any line has no quote marks ('>'), then none are stripped from any of them :: In [5]: strip_email_quotes('> > text\n> > more\nlast different') Out[5]: '> > text\n> > more\nlast different'

Aliases

  • IPython.terminal.magics.strip_email_quotes