Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e3bd104

Browse files
committed
Tweak wordsep_re again: this time to recognize an em-dash with
any non-whitespace characters adjacent, not just \w.
1 parent c6edb37 commit e3bd104

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/textwrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class TextWrapper:
5656
# (after stripping out empty strings).
5757
wordsep_re = re.compile(r'(\s+|' # any whitespace
5858
r'-*\w{2,}-(?=\w{2,})|' # hyphenated words
59-
r'(?<=\w)-{2,}(?=\w))') # em-dash
59+
r'(?<=\S)-{2,}(?=\S))') # em-dash
6060

6161
# XXX will there be a locale-or-charset-aware version of
6262
# string.lowercase in 2.3?

0 commit comments

Comments
 (0)