[ZPT] CVS: Packages/TAL - DummyEngine.py:1.14 TALDefs.py:1.12

guido@digicool.com guido@digicool.com
Fri, 16 Mar 2001 22:49:30 -0500 (EST)


Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv6139

Modified Files:
	DummyEngine.py TALDefs.py 
Log Message:
Several regular expressions were using ".*" without "DOTALL" mode, and
hence were unable to cope with the newlines that may occur in HTML
attributes.  This caused sustitution of "str:foo\nbar" to insert
"foo", omitting "\nbar".




--- Updated File DummyEngine.py in package Packages/TAL --
--- DummyEngine.py	2001/03/16 12:17:06	1.13
+++ DummyEngine.py	2001/03/17 03:49:29	1.14
@@ -121,7 +121,7 @@
         self.globals[name] = value
 
     def evaluate(self, expression):
-        m = re.match(r"(%s):(.*)" % NAME_RE, expression)
+        m = re.match(r"(?s)(%s):(.*)\Z" % NAME_RE, expression)
         if m:
             type, expr = m.group(1, 2)
         else:

--- Updated File TALDefs.py in package Packages/TAL --
--- TALDefs.py	2001/03/16 20:58:45	1.11
+++ TALDefs.py	2001/03/17 03:49:29	1.12
@@ -129,8 +129,8 @@
     pass
 
 import re
-_attr_re = re.compile(r"\s*([^\s]+)\s*(.*)")
-_subst_re = re.compile(r"\s*(?:(text|structure)\s+)?(.*)")
+_attr_re = re.compile(r"\s*([^\s]+)\s*(.*)\Z", re.S)
+_subst_re = re.compile(r"\s*(?:(text|structure)\s+)?(.*)\Z", re.S)
 del re
 
 def parseAttributeReplacements(arg):