[Zope-Checkins] CVS: Zope/lib/python/StructuredText - DocumentClass.py:1.45
Andreas Jung
andreas@digicool.com
Mon, 25 Feb 2002 10:37:19 -0500
Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv21628/StructuredText
Modified Files:
DocumentClass.py
Log Message:
a string '_blabla_' at the end of line has not been recognized properly
as text to be represented as underline.
- updated tests and HTML references
=== Zope/lib/python/StructuredText/DocumentClass.py 1.44 => 1.45 ===
def doc_underline(self,
s,
- #expr=re.compile(r"\_([a-zA-Z0-9\s\.,\?]+)\_").search, # old expr, inconsistent punc, failed to cross newlines
- expr=re.compile(r'_([%s%s%s\s]+)_[\s%s]' % (letters, digits, under_punc,phrase_delimiters)).search):
+ expr=re.compile(r'_([%s%s%s\s]+)_([\s%s]|$)' % (letters, digits, under_punc,phrase_delimiters)).search):
result = expr(s)
if result:
@@ -863,7 +862,7 @@
return None # no double unders
start,end = result.span(1)
st,e = result.span()
- return (StructuredTextUnderline(s[start:end]),st,e-1)
+ return (StructuredTextUnderline(s[start:end]),st,e-len(result.group(2)))
else:
return None