diff MoinMoin/PageGraphicalEditor.py @ 199:4e9b5e9610da

fixed editor preview throwing away page content for new pages imported from: moin--main--1.5--patch-201
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 06 Nov 2005 19:29:10 +0000
parents 722b8f648630
children b8f8c700eed9
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Sat Nov 05 22:46:35 2005 +0000
+++ b/MoinMoin/PageGraphicalEditor.py	Sun Nov 06 19:29:10 2005 +0000
@@ -38,7 +38,7 @@
         regex = re.compile(r"\(\?<![^)]*?\)")
         word_rule = regex.sub("", Parser.word_rule)
         return repr(word_rule)[1:]
-    
+
     def sendEditor(self, **kw):
         """
         Send the editor form page.
@@ -58,6 +58,7 @@
         _ = self._
         self.request.http_headers(self.request.nocache)
 
+        raw_body = ''
         msg = None
         conflict_msg = None
         edit_lock_message = None
@@ -169,8 +170,9 @@
 
         # Get the text body for the editor field.
         # TODO: what about deleted pages? show the text of the last revision or use the template?
-        raw_body = ''
-        if self.exists():
+        if preview is not None:
+            raw_body = self.get_raw_body()
+        elif self.exists():
             # If the page exists, we get the text from the page.
             # TODO: maybe warn if template argument was ignored because the page exists?
             raw_body = self.get_raw_body()