[CMF-checkins] CVS: Products/CMFDefault - Document.py:1.26

Jeffrey Shell jshell@cvs.zope.org
Mon, 6 Aug 2001 10:18:32 -0400

Update of /cvs-repository/Products/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv25854

Modified Files:
Log Message:
Fixed Document#guessFormat() to use utils.html_headcheck() instead of bodyfinder to detect structured text versus html.  Tested in tests.test_Document.DocumentTests#test_EditStructuredTextWithHTML()

=== Products/CMFDefault/Document.py 1.25 => 1.26 ===
     def guessFormat(self, text):
         """ Simple stab at guessing the inner format of the text """
-        if bodyfinder.search(text) is not None:
-            return 'html'
-        else:
-            return 'structured-text'
+        if utils.html_headcheck(text): return 'html'
+        else: return 'structured-text'
     def handleText(self, text, format=None, stx_level=None):