[Zope-Checkins] CVS: Packages/StructuredText -
DocumentWithImages.py:1.10.2.1
Andreas Jung
andreas at andreas-jung.com
Sun Nov 28 04:40:40 EST 2004
Update of /cvs-repository/Packages/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv18183/lib/python/StructuredText
Modified Files:
Tag: Zope-2_7-branch
DocumentWithImages.py
Log Message:
- Collector #631: Image URLs in StructuredText containing port
numbers were not rendered correctly
=== Packages/StructuredText/DocumentWithImages.py 1.10 => 1.10.2.1 ===
--- Packages/StructuredText/DocumentWithImages.py:1.10 Sun May 25 16:40:10 2003
+++ Packages/StructuredText/DocumentWithImages.py Sun Nov 28 04:40:09 2004
@@ -31,28 +31,7 @@
def doc_img(
self, s,
expr1=re.compile('\"([ _a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+)').search,
- expr2=re.compile('\"([ _a-zA-Z0-9*.:/;,\-\n\~]+)\":img:([a-zA-Z0-9\_\-.:/;,\n\~]+):([a-zA-Z0-9_\-.:/;,\n\~]+)').search
):
-
- r = expr2(s)
- if r:
-
- # Warning: the regex are getting confused when the string after :img:
- # is an URL containing ":" (Collector #2276)
- # Ugly workaround: check if have an absolute URL here. Not a cool solution,
- # but it works !
-
- if not r.group(2) in ['http','file','ftp']:
-
- startt, endt = r.span(1)
- startk, endk = r.span(2)
- starth, endh = r.span(3)
- start, end = r.span()
-
- key = s[startk:endk]
-
- return (StructuredTextImage(s[startt:endt], href=s[starth:endh], key=s[startk:endk]),
- start, end)
r=expr1(s)
More information about the Zope-Checkins
mailing list