[CMF-checkins] CVS: CMF/CMFDefault - utils.py:1.12

Ken Manheimer klm@zope.com
Fri, 7 Jun 2002 18:38:28 -0400

Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv10221

Modified Files:
Log Message:
Restrict the body strip (:-) to just stuff within an <html> tag that
is preceded only by whitespace, if anything.  This fixes a bug
(described in issue http://collector.zope.org/ColDev/74 ) with edits
to non-html documents.

=== CMF/CMFDefault/utils.py 1.11 => 1.12 ===
-_bodyre = re.compile(r'<body.*?>', re.DOTALL|re.I)
+_bodyre = re.compile(r'^\s*<html.*<body.*?>', re.DOTALL|re.I)
 _endbodyre = re.compile(r'</body', re.DOTALL|re.I)
 def bodyfinder(text):