[Zope-Checkins] CVS: Zope2 - DT_String.py:1.39.52.2

Andreas Jung andreas@dhcp165.digicool.com
Wed, 18 Apr 2001 12:08:16 -0400


Update of /cvs-repository/Zope2/lib/python/DocumentTemplate
In directory yetix:/work/sandboxes/ajung-2_4-ts_regex-exterminiation-branch/lib/python/DocumentTemplate

Modified Files:
      Tag: ajung-2_4-ts_regex-exterminiation-branch
	DT_String.py 
Log Message:
bug fix



--- Updated File DT_String.py in package Zope2 --
--- DT_String.py	2001/04/18 14:36:35	1.39.52.1
+++ DT_String.py	2001/04/18 16:08:15	1.39.52.2
@@ -85,7 +85,7 @@
 "$Id$"
 
 from string import split, strip
-import thread 
+import thread ,regex,re
 
 from DT_Util import ParseError, InstanceDict, TemplateDict, render_blocks, str
 from DT_Var import Var, Call, Comment
@@ -255,10 +255,14 @@
         return result
 
     skip_eol__roles__=()
-    def skip_eol(self, text, start, eol=regex.compile('[ \t]*\n')):
+
+    def skip_eol(self, text, start, eol=re.compile('[ \t]*\n',re.I)):
         # if block open is followed by newline, then skip past newline
-        l=eol.match(text,start)
-        if l > 0: start=start+l
+        
+        mo = eol.match(text,start)
+        if mo is not None: 
+            start=start+mo.end(0)-mo.start(0)
+
         return start
 
     parse_block__roles__=()