Commit cce4d67f authored by Greg Ward's avatar Greg Ward

Fix SF bug #596434: tweak wordsep_re so "--foo-bar" now splits

into /--foo-/bar/ rather than /--/foo-/bar/.  Needed for Optik and
Docutils to handle Unix-style command-line options properly.
parent ae469312
......@@ -55,7 +55,7 @@ class TextWrapper:
# Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!
# (after stripping out empty strings).
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
# XXX will there be a locale-or-charset-aware version of
......
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