[Zope-Checkins] CVS: Zope/lib/python/StructuredText - ClassicDocumentClass.py:1.12.10.4 DocumentClass.py:1.22.2.10 STletters.py:1.2.10.4
Andreas Jung
andreas@zope.com
Tue, 9 Oct 2001 09:20:30 -0400
Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv28670
Modified Files:
Tag: Zope-2_4-branch
ClassicDocumentClass.py DocumentClass.py STletters.py
Log Message:
- Multiple links in a paragraph with mixed link notation
(quotation+colon+URL or quotation+comma+whitespace+URL) did not
work properly (thanks to Alastair Burt for reporting and submitting
the patch).
=== Zope/lib/python/StructuredText/ClassicDocumentClass.py 1.12.10.3 => 1.12.10.4 ===
text_types = [
- 'doc_href',
+ 'doc_href1',
+ 'doc_href2',
'doc_strong',
'doc_emphasize',
'doc_literal',
@@ -629,6 +630,7 @@
def doc_underline(self,
s,
expr=re.compile("_([%s0-9\s\.,\?\/]+)_" % letters).search):
+
result = expr(s)
if result:
@@ -649,16 +651,23 @@
return (StructuredTextStrong(s[start:end]), start-2, end+2)
else:
return None
-
- def doc_href(
- self, s,
- expr1 = re.compile("(\"[ %s0-9\n\-\.\,\;\(\)\/\:\/\*\']+\")(:)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)([,]*\s*)" % letters).search,
- expr2 = re.compile('(\"[ %s0-9\n\-\.\:\;\(\)\/\*\']+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)(\s*)' % letters).search,
- punctuation = re.compile("[\,\.\?\!\;]+").match
+
+
+
+ def doc_href1(self, s,
+ expr=re.compile("(\"[ %s0-9\n\-\.\,\;\(\)\/\:\/\*\']+\")(:)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)([,]*\s*)" % letters).search
):
-
- r=expr1(s) or expr2(s)
+ return self.doc_href(s, expr)
+ def doc_href2(self, s,
+ expr=re.compile('(\"[ %s0-9\n\-\.\:\;\(\)\/\*\']+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)(\s*)' % letters).search
+ ):
+ return self.doc_href(s, expr)
+
+ def doc_href(self, s, expr, punctuation = re.compile("[\,\.\?\!\;]+").match):
+
+ r=expr(s)
+
if r:
# need to grab the href part and the
# beginning part
=== Zope/lib/python/StructuredText/DocumentClass.py 1.22.2.9 => 1.22.2.10 ===
text_types = [
'doc_sgml',
- 'doc_href',
+ 'doc_href1',
+ 'doc_href2',
'doc_strong',
'doc_emphasize',
'doc_underline',
@@ -955,13 +956,22 @@
_ABS_AND_RELATIVE_URL=r'([%s0-9_\@\.\,\?\!\/\:\;\-\#\~\=\&\%%]+)' % letters
_SPACES = r'(\s*)'
-
- def doc_href(self, s,
- 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)
+
+
+ def doc_href1(self, s,
+ expr=re.compile(_DQUOTEDTEXT + "(:)" + _ABS_AND_RELATIVE_URL + _SPACES).search
+ ):
+ return self.doc_href(s, expr)
+
+ def doc_href2(self, s,
+ expr=re.compile(_DQUOTEDTEXT + r'(\,\s+)' + _ABSOLUTE_URL + _SPACES).search
+ ):
+ return self.doc_href(s, expr)
+
+
+ def doc_href(self, s, expr, punctuation=re.compile(r"[\,\.\?\!\;]+").match):
+
+ r=expr(s)
if r:
# need to grab the href part and the
=== Zope/lib/python/StructuredText/STletters.py 1.2.10.3 => 1.2.10.4 ===
under_punc = punc_func('_')
phrase_delimiters = r'\s\.\,\?\/\!\&\(\)'
+