Tweak wordsep_re again: this time to recognize an em-dash with

any non-whitespace characters adjacent, not just \w.
This commit is contained in:
Greg Ward 2002-08-22 21:28:00 +00:00
parent c6edb37268
commit e3bd104aa7

View File

@ -56,7 +56,7 @@ class TextWrapper:
# (after stripping out empty strings).
wordsep_re = re.compile(r'(\s+|' # any whitespace
r'-*\w{2,}-(?=\w{2,})|' # hyphenated words
r'(?<=\w)-{2,}(?=\w))') # em-dash
r'(?<=\S)-{2,}(?=\S))') # em-dash
# XXX will there be a locale-or-charset-aware version of
# string.lowercase in 2.3?