Commit a409f7c4 authored by Greg Ward's avatar Greg Ward

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.
parent cc55cb95
......@@ -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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment