[Python-bugs-list] [ python-Bugs-596434 ] textwrap has problems wrapping hyphens
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 25 Aug 2002 07:29:27 -0700
Bugs item #596434, was opened at 2002-08-17 10:46
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=596434&group_id=5470
Category: Python Library
Group: Python 2.3
>Status: Open
Resolution: Fixed
Priority: 5
Submitted By: David Goodger (goodger)
Assigned to: Greg Ward (gward)
Summary: textwrap has problems wrapping hyphens
Initial Comment:
(Greg already knows about this from private mail;
this makes it "official".)
Long multi-word command-line options (begin
with "--" and contain internal "-") inside text may be
wrapped badly by textwrap. For example, "--an-
option" may become "--\nan-option" or "--an-\
noption". Perhaps words that begin with hyphens
should not be wrapped at all?
----------------------------------------------------------------------
>Comment By: David Goodger (goodger)
Date: 2002-08-25 10:29
Message:
Logged In: YES
user_id=7733
There's still an edge case that gives poor results. Try
wrapping "--text--.". It will wrap like "--text/--/.", leaving
just the period (".") or the dashes & period ("--.") on the
next line. The latter may or may not be a problem, but
I'd say wrapping just the sentence-ending period
definitely *is* a problem.
A more plausible example is "what the--.".
----------------------------------------------------------------------
Comment By: Greg Ward (gward)
Date: 2002-08-22 17:04
Message:
Logged In: YES
user_id=14422
Thanks for the reminder, David!
Fixed in Lib/textwrap.py rev 1.14.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=596434&group_id=5470