diff options
author | Greg Ward <gward@python.net> | 2003-05-07 01:20:58 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2003-05-07 01:20:58 (GMT) |
commit | a409f7c491647fe0c256c944d6fe4e9593d15760 (patch) | |
tree | a3af354e2a19a27b1933bceca251b5a56b04a068 | |
parent | cc55cb95394469d8d250ffa810ab9f76881bffa1 (diff) | |
download | cpython-a409f7c491647fe0c256c944d6fe4e9593d15760.zip cpython-a409f7c491647fe0c256c944d6fe4e9593d15760.tar.gz cpython-a409f7c491647fe0c256c944d6fe4e9593d15760.tar.bz2 |
SF #596434: tweak wordsep_re so the definition of an em-dash is
stricter: specifically, "--" must be preceded by a limited set of
characters, not by any non-whitespace character.
-rw-r--r-- | Lib/textwrap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py index fdb95d7..b0c7042 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -75,7 +75,7 @@ class TextWrapper: # (after stripping out empty strings). wordsep_re = re.compile(r'(\s+|' # any whitespace r'-*\w{2,}-(?=\w{2,})|' # hyphenated words - r'(?<=\S)-{2,}(?=\w))') # em-dash + r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of # string.lowercase in 2.3? |