(
    msg: str, subtract: int = 0, dedent: bool = True, prefix: str = ''
)
return '\n'.join(textwrap.fill(chunk, width=width, break_on_hyphens=False) for chunk in chunks)
Line wrap the given message to PRINTER_WIDTH - {subtract}. Convert double
    newlines to newlines and avoid calling textwrap.fill() on them (like
    markdown)
Line wrap the given message to PRINTER_WIDTH - {subtract}. Convert double
    newlines to newlines and avoid calling textwrap.fill() on them (like
    markdown)
Line wrap the given message to PRINTER_WIDTH - { subtract } . Convert double newlines to newlines and avoid calling textwrap . fill () on them ( like markdown )
def line_wrap_message(
    msg: str, subtract: int = 0, dedent: bool = True, prefix: str = ''
) -> str:
    '''
    Line wrap the given message to PRINTER_WIDTH - {subtract}. Convert double
    newlines to newlines and avoid calling textwrap.fill() on them (like
    markdown)
    '''
    width = printer_width() - subtract
    if dedent:
        msg = textwrap.dedent(msg)

    if prefix:
        msg = f'{prefix}{msg}'

    # If the input had an explicit double newline, we want to preserve that
    # (we'll turn it into a single line soon). Support windows, too.
    splitter = '\r\n\r\n' if '\r\n\r\n' in msg else '\n\n'
    chunks = msg.split(splitter)
    return '\n'.join(textwrap.fill(chunk, width=width, break_on_hyphens=False) for chunk in chunks)
def line_wrap_message ( msg : str , subtract : int = 0 , dedent : bool = True , prefix : str = '' ) -> str : width = printer_width ( ) - subtract if dedent : msg = textwrap . dedent ( msg ) if prefix : msg = f'{prefix}{msg}' # If the input had an explicit double newline, we want to preserve that # (we'll turn it into a single line soon). Support windows, too. splitter = '\r\n\r\n' if '\r\n\r\n' in msg else '\n\n' chunks = msg . split ( splitter ) return '\n' . join ( textwrap . fill ( chunk , width = width , break_on_hyphens = False ) for chunk in chunks )