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:
parent
c6edb37268
commit
e3bd104aa7
@ -56,7 +56,7 @@ class TextWrapper:
|
|||||||
# (after stripping out empty strings).
|
# (after stripping out empty strings).
|
||||||
wordsep_re = re.compile(r'(\s+|' # any whitespace
|
wordsep_re = re.compile(r'(\s+|' # any whitespace
|
||||||
r'-*\w{2,}-(?=\w{2,})|' # hyphenated words
|
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
|
# XXX will there be a locale-or-charset-aware version of
|
||||||
# string.lowercase in 2.3?
|
# string.lowercase in 2.3?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user