[Zope-Checkins] CVS: Zope2 - DocumentClass.py:1.22.2.3
chrism@serenade.digicool.com
chrism@serenade.digicool.com
Mon, 25 Jun 2001 22:17:37 -0400
Update of /cvs-repository/Zope2/lib/python/StructuredText
In directory serenade:/home/chrism/sandboxes/Zope24Branch/lib/python/StructuredText
Modified Files:
Tag: Zope-2_4-branch
DocumentClass.py
Log Message:
Merge from trunk.
--- Updated File DocumentClass.py in package Zope2 --
--- DocumentClass.py 2001/06/25 23:32:18 1.22.2.2
+++ DocumentClass.py 2001/06/26 02:17:36 1.22.2.3
@@ -951,12 +951,13 @@
## Some constants to make the doc_href() regex easier to read.
_DQUOTEDTEXT = r'("[ %s0-9\n\r\-\.\,\;\(\)\/\:\/\*\']+")' % letters ## double quoted text
- _URL_AND_PUNC = r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\#\~]+)' % letters
+ _ABSOLUTE_URL=r'((http|https|ftp|mailto|file|about)[:/]+?[%s0-9_\@\.\,\?\!\/\:\;\-\#\~]+)' % letters
+ _ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\#\~]+)' % letters
_SPACES = r'(\s*)'
def doc_href(self, s,
- expr1 = re.compile(_DQUOTEDTEXT + "(:)" + _URL_AND_PUNC + _SPACES).search,
- expr2 = re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _URL_AND_PUNC + _SPACES).search):
+ expr1 = re.compile(_DQUOTEDTEXT + "(:)" + _ABS_AND_RELATIVE_URL + _SPACES).search,
+ expr2 = re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _ABSOLUTE_URL + _SPACES).search):
punctuation = re.compile(r"[\,\.\?\!\;]+").match
r=expr1(s) or expr2(s)