diff -r -u -N pywiki-0.4.2/cgievents.py pywiki/cgievents.py
--- pywiki-0.4.2/cgievents.py	Tue Feb  8 16:10:53 2000
+++ pywiki/cgievents.py	Sun Feb  3 22:41:31 2002
@@ -513,7 +513,8 @@
             (page, revision, datetime) = GetPage(archiveDir, 'TestPage', '')
             postText = testPostTextStdIn
             postText = postText + '&tip_date_time=' + datetime
-            oc = pyunit.OutputComparator('testfiles/cgievents.pt.test.out')
+            filename = 'testfiles/cgievents.pt.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
@@ -525,6 +526,7 @@
             finally:    
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testRecentChangesCreation(self):
             console = sys.stdout        # discard stdio during setup
@@ -548,15 +550,22 @@
             (page, revision, datetime) = GetPage(archiveDir, 'TestPage', '')
             postText = testPostTextStdIn
             postText = postText + '&tip_date_time=' + datetime
-            oc = pyunit.OutputComparator('testfiles/cgievents.ptc.test.out')
-            oc.beginCapture()
+            filename1 = 'testfiles/cgievents.ptc1.test.out'
+            oc1 = pyunit.OutputComparator(filename1)
+            oc1.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
             en['REQUEST_METHOD'] = 'POST'
             en['CONTENT_LENGTH'] = str(len(postText))
             en['REMOTE_ADDR'] = '192.168.1.1'
             CgiEvents(testConfiguration).Process(en, StringIO(postText))
-
+            oc1.endCapture()
+            self.should(oc1.compare(), "Output differs from reference file.")
+            self.validateHtml(filename1)
+
+            filename2 = 'testfiles/cgievents.ptc2.test.out'
+            oc2 = pyunit.OutputComparator(filename2)
+            oc2.beginCapture()
             postText = testPostTextStdIn
             postText = postText + '&tip_date_time=bogustime'
             en['CONTENT_LENGTH'] = str(len(postText))
@@ -564,11 +573,13 @@
             try:
                 CgiEvents(testConfiguration).Process(en, StringIO(postText))
             finally:    
-                oc.endCapture()
-                self.should(oc.compare(), "Output differs from reference file.")
+                oc2.endCapture()
+                self.should(oc2.compare(), "Output differs from reference file.")
+                self.validateHtml(filename2)
 
         def testPostAddNotification(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.pan.test.out')
+            filename = 'testfiles/cgievents.pan.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
@@ -581,6 +592,7 @@
             finally:    
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testPostDelNotification(self):
             console = sys.stdout        # discard stdio during setup
@@ -594,7 +606,8 @@
                                            StringIO(testPostAddNotifyStdIn))
             sys.stdout.close()          # restore stdio
             sys.stdout = console
-            oc = pyunit.OutputComparator('testfiles/cgievents.pdn.test.out')
+            filename = 'testfiles/cgievents.pdn.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en['CONTENT_LENGTH'] = str(len(testPostDelNotifyStdIn))
             try:
@@ -603,9 +616,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testPostDelNonExistNotification(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.pdnen.test.out')
+            filename = 'testfiles/cgievents.pdnen.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
@@ -618,9 +633,11 @@
             finally:    
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetDefaultPage(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gdp.test.out')
+            filename = 'testfiles/cgievents.gdp.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
@@ -632,9 +649,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetPage(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gp.test.out')
+            filename = 'testfiles/cgievents.gp.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'TestPage'
@@ -646,9 +665,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetPageEditor(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gpe.test.out')
+            filename = 'testfiles/cgievents.gpe.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'edit=TestPage'
@@ -660,9 +681,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetPageEditorNonExist(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gpene.test.out')
+            filename = 'testfiles/cgievents.gpene.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'edit=NonExistPage'
@@ -674,9 +697,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetPageEditorRequestedSize(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gpez.test.out')
+            filename = 'testfiles/cgievents.gpez.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'edit=TestPage&rows=9&cols=40'
@@ -688,9 +713,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetNotificationForm(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gnf.test.out')
+            filename = 'testfiles/cgievents.gnf.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'notification=TestPage'
@@ -702,9 +729,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetCopy(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gc.test.out')
+            filename = 'testfiles/cgievents.gc.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'copy=TestPage'
@@ -716,6 +745,7 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testNotification(self):
             oc = pyunit.OutputComparator('testfiles/cgievents.ntfy.test.out')
@@ -769,7 +799,8 @@
             return
 
         def testGetPageWithSearch(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gps.test.out')
+            filename = 'testfiles/cgievents.gps.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'TestPage&value=search string'
@@ -781,9 +812,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testGetPageEditorRev(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.gper.test.out')
+            filename = 'testfiles/cgievents.gper.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'edit=TestPage&rev=1.1'
@@ -795,9 +828,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testSearchWord(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.srchw.test.out')
+            filename = 'testfiles/cgievents.srchw.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'search=best'
@@ -809,9 +844,11 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
 
         def testSearchEmbedded(self):
-            oc = pyunit.OutputComparator('testfiles/cgievents.srche.test.out')
+            filename = 'testfiles/cgievents.srche.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = 'search=nTerna'
@@ -823,7 +860,7 @@
             finally:
                 oc.endCapture()
                 self.should(oc.compare(), "Output differs from reference file.")
-
+                self.validateHtml(filename)
 
     class TabTest(pyunit.TestCase):
 
@@ -852,7 +889,8 @@
             (page, revision, datetime) = GetPage(archiveDir, 'TestPage', '')
             postText = testPostTextCvtStdIn
             postText = postText + '&tip_date_time=' + datetime
-            oc = pyunit.OutputComparator('testfiles/cgievents.ttc.test.out')
+            filename = 'testfiles/cgievents.ttc.test.out'
+            oc = pyunit.OutputComparator(filename)
             oc.beginCapture()
             en = {}
             en['QUERY_STRING'] = ''
@@ -871,6 +909,7 @@
                                                      'TestPage', '1.1')
                 ir = page['text']
                 self.should(oc.compare(), "Output differs from reference file.")
+                self.validateHtml(filename)
                 self.should(tr == ir)
 
 
diff -r -u -N pywiki-0.4.2/pagemodel.py pywiki/pagemodel.py
--- pywiki-0.4.2/pagemodel.py	Tue Feb  8 16:10:53 2000
+++ pywiki/pagemodel.py	Sun Feb  3 22:41:31 2002
@@ -125,7 +125,7 @@
         for line in page['text']:
             m = regExp.search(line)
             if m:
-                searchResults.append(pageName, m.group(0))
+                searchResults.append((pageName, m.group(0)))
                 pagesFound = pagesFound + 1
                 break
         pagesSearched = pagesSearched + 1
diff -r -u -N pywiki-0.4.2/pageview.py pywiki/pageview.py
--- pywiki-0.4.2/pageview.py	Tue Feb  8 16:10:53 2000
+++ pywiki/pageview.py	Sun Feb  3 22:41:31 2002
@@ -28,6 +28,7 @@
 from cgi import *
 import re, traceback
 import pagemodel
+import sys
 
 BOGUS_NAME = 'bogusPage'
 
@@ -81,16 +82,18 @@
     """
           
     esc_searchString = escape(SearchString)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title> Search for ' + esc_searchString + '</title></head>'
-    print '<body><h1><img src="' + Configuration.logoUrl \
-           + '"> SearchResults</h1>'
+    print '<body><h1>'
+    _pywikiLogo(Configuration)
+    print 'SearchResults</h1>'
+    print '<p>'
     for page, inword in SearchResults:
         print '<a href="' + Configuration.scriptName + '?' + page + '">' \
               + page + '</a> . . . . . .  ' + inword + '<br>'
     print '<hr>'
-    print '%s pages found out of %s pages searched.' % \
+    print '<p>%s pages found out of %s pages searched.' % \
           (ArchivesFound, ArchivesSearched)
     print '</body>'
     print '</html>'
@@ -108,22 +111,21 @@
             the page.
     """
     esc_name = escape(PageName)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title>' + esc_name + '</title></head>'
-    print '<body><h1><img src="' + Configuration.logoUrl + '">'
+    print '<body><h1>'
+    _pywikiLogo(Configuration)
     print '<a href="' + Configuration.scriptName + '?search=' \
           + esc_name + '">' + esc_name + '</a></h1>'
-    print '<form>'
     wt = WikiTranslator(Configuration, PageText, PageLinks, SearchArg)
     for line in wt.TranslateToHtmlLines():
         print line,
-    print '</form>'
     print '<hr>'
-    print '<a href="' + Configuration.scriptName + '?edit=' \
+    print '<p><a href="' + Configuration.scriptName + '?edit=' \
           + esc_name + '">EditText</a> of this page'
     print '(last edited %s)<br>' % Date
-    print '<a href="' + Configuration.scriptName + '?FindPage&value=' \
+    print '<a href="' + Configuration.scriptName + '?FindPage&amp;value=' \
           + esc_name + '">FindPage</a> by browsing or searching<br>'
     if Configuration.notificationEnabled == 1:
         print '<a href="' + Configuration.scriptName + '?notification=' \
@@ -151,15 +153,16 @@
     """
     esc_name = escape(PageName)
     esc_rev = escape(PageRevision)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title>Edit ' + esc_name + '</title></head>'
     print '<body><form method="POST" action="' + Configuration.scriptName \
            + '">'
     print '<h1>' + esc_name + ' <input type="submit" value=" Save ">'
     print '<input type="reset" value=" Reset "></h1>'
+    print '<p>'
     sys.stdout.write(
-      '<TEXTAREA NAME="text" ROWS=%s COLS=%s wrap=virtual>' %
+      '<TEXTAREA NAME="text" ROWS=%s COLS=%s>' %
       (Rows,Cols))
     for line in PageText:
         sys.stdout.write(escape(line))
@@ -187,6 +190,7 @@
     else:
         link4 = ""    
     print '<h1>Links</h1>'
+    print '<p>'
     print '[1] <input type="text" size=55 name="r1" value="' + link1 + '"><br>'
     print '[2] <input type="text" size=55 name="r2" value="' + link2 + '"><br>'
     print '[3] <input type="text" size=55 name="r3" value="' + link3 + '"><br>'
@@ -197,11 +201,12 @@
           '?GoodStyle">GoodStyle</a> tips for editing.<br>'
     if esc_rev != '':
         print '<a href="' + Configuration.scriptName + \
-              '?rows=12&cols=60&edit=' + esc_name + '&rev=' + esc_rev + \
+              '?rows=12&amp;cols=60&amp;edit=' + esc_name + \
+              '&amp;rev=' + esc_rev + \
               '">EditPage</a> using a smaller text area.<br>'
     else:
         print '<a href="' + Configuration.scriptName + \
-              '?rows=12&cols=60&edit=' + esc_name + \
+              '?rows=12&amp;cols=60&amp;edit=' + esc_name + \
               '">EditPage</a> using a smaller text area.<br>'
     print '<a href="' + Configuration.scriptName + \
           '?copy=' + esc_name + '">EditCopy</a> from earlier revision.<br>'
@@ -232,7 +237,7 @@
     """
     esc_name = escape(PageName)
     esc_rev = escape(PageRevision)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title>' + esc_name + ' Notification</title></head>'
     print '<body><form method="POST" action="' + Configuration.scriptName \
@@ -240,6 +245,7 @@
     print '<h1>' + esc_name + ' Notification'
     print '<input type="submit" value=" Ok ">'
     print '<input type="reset" value=" Reset "></h1>'
+    print '<p>'
     print 'Email Address <input type="text" size=55 name="address" value=""><br>'
     print '<input type="radio" name="action" value="add"> Subscribe<br> '
     print '<input type="radio" name="action" value="del"> Unsubscribe<br><p>'
@@ -271,18 +277,18 @@
     esc_name = escape(PageName)
     esc_address = escape(Address)
     esc_contributor = escape(Contributor)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title>Notifications for ' + esc_name \
           + ' Changed</title></head>'
           
     print '<body><h1>Notifications for ' + esc_name + ' Changed</h1>'
     if State == 1:
-        print 'Notification will be sent to ' \
+        print '<p>Notification will be sent to ' \
         + esc_address + ' when <a href="' + Configuration.scriptName \
         + '?' + esc_name + '">' + esc_name + '</a> is changed.<br>'
     else:
-        print 'Notification will no longer be sent to ' \
+        print '<p>Notification will no longer be sent to ' \
         + esc_address + ' when <a href="' + Configuration.scriptName \
         + '?' + esc_name + '">' + esc_name + '</a> is changed.<br>'
     
@@ -299,11 +305,11 @@
     """    
     esc_name = escape(PageName)
     esc_contributor = escape(Contributor)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
-    print '<head><title>Thanks for ' + esc_name + ' Edits</title></head><body>'
+    print '<head><title>Thanks for ' + esc_name + ' Edits</title></head>'
     print '<body><h1>Thanks for editing ' + esc_name + '.</h1>'
-    print 'Thank you for editing <a href="' + Configuration.scriptName + \
+    print '<p>Thank you for editing <a href="' + Configuration.scriptName + \
           '?' + esc_name + '">' + esc_name + '</a>.<br>'
     print 'p.s. Be sure to <em>Reload</em> your old pages.<br>'
     print '</body>'
@@ -321,13 +327,13 @@
         of that revision, and Contributor identifies the entity
         responsible for the revision.
     """
-    _contentTypeHeader()
+    _standardProlog()
     esc_name = escape(PageName)
     print '<html>'
-    print '<body>'
     print '<head><title>' + esc_name + ' Revisions</title></head>'
-    print '<body><h1><img src="' + Configuration.logoUrl + '">' + esc_name + \
-          ' Revision Log</h1>'
+    print '<body><h1>'
+    _pywikiLogo(Configuration)
+    print esc_name + ' Revision Log</h1>'
     rev, revDate, contributor = LogEntries[0]
     print '<dl>'
     print '<dt>' + rev + ' - Current Revision'
@@ -357,13 +363,13 @@
         Title is the title for the error page.
         ErrorText is the text of the desired error message.
     """
-    _contentTypeHeader()
+    _standardProlog()
     esc_title = escape(Title)
     print '<html>'
     print '<head><title>' + esc_title + '</title></head>'
     print '<body><h1>' + esc_title + '</h1>'
-    print escape(ErrorText)
     print '<p>'
+    print escape(ErrorText)
     print '</body>'
     print '</html>'
     return
@@ -376,7 +382,7 @@
         Title is the title for the error page.
         ErrorText is the text of the desired error message.
     """
-    _contentTypeHeader()
+    _standardProlog()
     esc_title = escape(Title)
     print '<html>'
     print '<head><title>' + esc_title + '</title></head>'
@@ -396,7 +402,7 @@
         Title is the title for the information page.
         InfoText is the text of the desired error message.
     """
-    _contentTypeHeader()
+    _standardProlog()
     esc_title = escape(Title)
     print '<html>'
     print '<head><title>' + esc_title + '</title></head>'
@@ -415,7 +421,7 @@
         ReportText is the text of the desired report.
     """
     esc_title = escape(PageTitle)
-    _contentTypeHeader()
+    _standardProlog()
     print '<html>'
     print '<head><title>' + esc_title + '</title></head>'
     print '<body><h1>' + esc_title + '</h1>'
@@ -432,6 +438,26 @@
     print "Content-type: text/html"    # HTML is following
     print                              # blank line, end of headers
 
+def _doctypeDecl():
+    
+    """ Send a document type declaration.  internal use only.
+    """
+    print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'
+    print '                      "http://www.w3.org/TR/html4/strict.dtd">'
+
+def _pywikiLogo(Configuration):
+
+    """ Send the link to the pywiki logo.  internal use only.
+    """
+    print '<img src="' + Configuration.logoUrl + '" alt="PyWiki Logo">'
+
+def _standardProlog():
+
+    """ Send the standard stuff at the top of every page
+    """
+    _contentTypeHeader()
+    _doctypeDecl()
+
 
 #--- Wiki Translation ---------------------------------------------------------
 
@@ -479,14 +505,15 @@
         """
         """
         self.htmlPageText = []
+        self.htmlPageText.append('<p>')
         estk = self.emitterStack(self.htmlPageText)
         self.inPlaceUrls = 0
         self.inPlaceUrlList = []
         for line in self.pageText:
             line = self.urlExpr.sub(self.urlPlaceHolder, line)
-            line = self.ampExpr.sub('&amp', line)
-            line = self.ltExpr.sub('&lt', line)
-            line = self.gtExpr.sub('&gt', line)
+            line = self.ampExpr.sub('&amp;', line)
+            line = self.ltExpr.sub('&lt;', line)
+            line = self.gtExpr.sub('&gt;', line)
             Code = ""
             (line, subsMade) = self.blankExpr.subn('<p>', line)
             if subsMade > 0:
@@ -514,13 +541,22 @@
 
             line = self.strongExpr.sub(self.substituteStrongText, line)
             line = self.emphExpr.sub(self.substituteEmphasizedText, line)
-            line = self.hrExpr.sub('<hr>', line)
+            line = self.hrExpr.sub('<hr><p>', line)
             line = self.internExpr.sub(self.substituteInternalLink, line)
             line = self.externExpr.sub(self.substituteExternalLink, line)
             line = self.inplaceurlExpr.sub(self.substituteInPlaceUrls, line)
             line = self.searchExpr.sub(self.substituteSearchField, line)
             self.htmlPageText.append(line)
         estk.emitCode("", 0)
+        # Awful hack to move some tags to the correct (HTML valid) side
+        # of <p> tags.
+        for i in range(len(self.htmlPageText) - 1):
+            if self.htmlPageText[i] == '<p>':
+                targetTags = ['</PRE>\n', '</UL>\n', '</OL>\n', '</DL>\n']
+                if self.htmlPageText[i + 1] in targetTags:
+                    self.htmlPageText[i], self.htmlPageText[i + 1] = \
+                                          (self.htmlPageText[i + 1],
+                                           self.htmlPageText[i])
         return self.htmlPageText
 
     def urlPlaceHolder(self, MatchObject):
@@ -532,7 +568,7 @@
     def substituteInPlaceUrls(self, MatchObject):
         url = self.inPlaceUrlList[int(MatchObject.group(1))]
         if self.imageExpr.match(url):
-            return ('<img src="%s">' % (url))
+            return ('<img src="%s" alt="embedded image">' % (url))
         else:
             return ('<a href="%s">%s</a>' % (url,url))
 
@@ -581,14 +617,13 @@
         if self.links.has_key(linkNum) and self.links[linkNum] != '':
             url = self.links[linkNum]
             if self.imageExpr.match(url):
-                return '<img src="' + url + '">'
+                return '<img src="' + url + '" alt="embedded image">'
             else:
                 return '<a href="' + url + '">[' + linkNum + ']</a>'
         else:
                 return MatchObject.group(0)
 
     def substituteSearchField(self, MatchObject):
-        return '<p><form><input type="text" size="40" name="search" value="' \
-               + self.searchArg + '"></form><p>'
-
-
+        return '<form action="' + self.configuration.scriptName + '">' + \
+               '<p><input type="text" size="40" name="search" value="' + \
+               self.searchArg + '"></form><p>'
diff -r -u -N pywiki-0.4.2/picklarchive.py pywiki/picklarchive.py
--- pywiki-0.4.2/picklarchive.py	Tue Feb  8 16:10:53 2000
+++ pywiki/picklarchive.py	Sun Feb  3 22:41:31 2002
@@ -281,7 +281,7 @@
                         contributor = originator
                     else:
                         contributor = ''   
-                revisions.append(revision, revisionDate, contributor)
+                revisions.append((revision, revisionDate, contributor))
             index = index + 1    
     return revisions
 
diff -r -u -N pywiki-0.4.2/pyunit.py pywiki/pyunit.py
--- pywiki-0.4.2/pyunit.py	Tue Feb  8 16:10:53 2000
+++ pywiki/pyunit.py	Sun Feb  3 22:41:31 2002
@@ -107,6 +107,9 @@
         """ Constructs a test case with the given name."""
         self.testToRun = TestName
 
+    def validateHtml(self, filename):
+        self.should(HtmlValidator(filename).validate(), "Invalid HTML")
+
     def should(self, BooleanExpression, Message=''):
         """ Asserts that a condition is true. If it isn't it throws
             a UnitFailure with an optional message.
@@ -298,7 +301,26 @@
         
     def shouldStop(self):
         """ Checks whether the test run should stop."""
-        return self.stopFlag    
+        return self.stopFlag
+
+
+class HtmlValidator:
+
+    def __init__(self, FileName):
+        self.fileName = FileName
+
+    def validate(self):
+        validateFileName = self.fileName + '.validate'
+        os.system(('sed -e "s/^Content-type: text\\/html$//g" %s ' +
+                   '| validate 2>&1 > %s') %
+                  (quotate(self.fileName), quotate(validateFileName)))
+        if os.stat(validateFileName)[ST_SIZE] == 0:
+            return 1
+        else:
+            print
+            print 'Invalid HTML in ' + self.fileName + ':'
+            printFileToStdout(validateFileName)
+            return 0
 
 
 class OutputComparator:
@@ -319,38 +341,45 @@
         sys.stdout = self.console
         sys.stderr = self.error
         return
-        
+
     def compare(self):
-        if not exists(self.fileName + '.ref'):
-            resp = raw_input('No reference. Would you like to see output? (y/n)')
+        if not exists(self.referenceFilename()):
+            print('Reference file ' + self.referenceFilename() + ' missing.')
+            resp = raw_input('Would you like to see output? (y/n)')
             if resp == 'y' or resp == 'Y':
                 printFileToStdout(self.fileName)
             resp = raw_input('Would you like to save this as reference? (y/n)')
             if resp == 'y' or resp == 'Y':
-                removeFile(self.fileName + '.ref')
-                os.rename(self.fileName, self.fileName + '.ref')
+                self._saveOutputAsReference()
                 return 1
             else:
                 return 0    
         else:
             os.system('diff %s %s > %s' %
-              (quotate(self.fileName + '.ref'), quotate(self.fileName),
+              (quotate(self.referenceFilename()), quotate(self.fileName),
                quotate(self.fileName + '.diffs')))
             if os.stat(self.fileName + '.diffs')[ST_SIZE] != 0:
-                resp = raw_input('The test output is different from the \
-reference file. Would you like to see the differences? (y/n)')
+                print('Test output ' + self.fileName + ' is different ' +
+                      'the reference file.')
+                resp = raw_input('Would you like to see ' +
+                                 'the differences? (y/n)')
                 if resp == 'y' or resp == 'Y':
                     printFileToStdout(self.fileName + '.diffs')
                 resp = raw_input('Would you like to save the new output as \
 reference? (y/n)')
                 if resp == 'y' or resp == 'Y':
-                    removeFile(self.fileName + '.ref')
-                    os.rename(self.fileName, self.fileName + '.ref')
+                    self._saveOutputAsReference()
                     return 1
                 else:
                     return 0
             else:
-                return 1        
+                return 1
+
+    def _saveOutputAsReference(self):
+        os.system("cp %s %s" % (self.fileName, self.referenceFilename()))
+
+    def referenceFilename(self):
+        return self.fileName + '.ref'
 
 
 """ The TextTestResult (derived from TestResult, includes textual feedback.
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gc.test.out.ref pywiki/testfiles/cgievents.gc.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gc.test.out.ref	Tue Feb  8 16:10:54 2000
+++ pywiki/testfiles/cgievents.gc.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,13 +1,16 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
-<body>
 <head><title>TestPage Revisions</title></head>
-<body><h1><img src="/pywiki.gif">TestPage Revision Log</h1>
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
+TestPage Revision Log</h1>
 <dl>
 <dt>1.1 - Current Revision
 <dd><ul>
-<li> revised: 2000/02/08
+<li> revised: 2002/02/03
 <li> by: tester
 </ul></dl>
 <hr>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gdp.test.out.ref pywiki/testfiles/cgievents.gdp.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gdp.test.out.ref	Tue Feb  8 16:10:54 2000
+++ pywiki/testfiles/cgievents.gdp.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,15 +1,16 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>FrontPage</title></head>
-<body><h1><img src="/pywiki.gif">
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
 <a href="pywiki?search=FrontPage">FrontPage</a></h1>
-<form>
-Discuss FrontPage<a href="pywiki?FrontPage">?</a> here. </form>
-<hr>
-<a href="pywiki?edit=FrontPage">EditText</a> of this page
+<p> Discuss FrontPage<a href="pywiki?FrontPage">?</a> here. <hr>
+<p><a href="pywiki?edit=FrontPage">EditText</a> of this page
 (last edited )<br>
-<a href="pywiki?FindPage&value=FrontPage">FindPage</a> by browsing or searching<br>
+<a href="pywiki?FindPage&amp;value=FrontPage">FindPage</a> by browsing or searching<br>
 <a href="pywiki?notification=FrontPage">SubscribeForChangeNotification</a> via email for this page (or unsubscribe)<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gnf.test.out.ref pywiki/testfiles/cgievents.gnf.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gnf.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.gnf.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,11 +1,14 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>TestPage Notification</title></head>
 <body><form method="POST" action="pywiki">
 <h1>TestPage Notification
 <input type="submit" value=" Ok ">
 <input type="reset" value=" Reset "></h1>
+<p>
 Email Address <input type="text" size=55 name="address" value=""><br>
 <input type="radio" name="action" value="add"> Subscribe<br> 
 <input type="radio" name="action" value="del"> Unsubscribe<br><p>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gp.test.out.ref pywiki/testfiles/cgievents.gp.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gp.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.gp.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,15 +1,16 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>TestPage</title></head>
-<body><h1><img src="/pywiki.gif">
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
 <a href="pywiki?search=TestPage">TestPage</a></h1>
-<form>
-Please discuss <a href="pywiki?TestPage">TestPage</a> here. </form>
-<hr>
-<a href="pywiki?edit=TestPage">EditText</a> of this page
-(last edited 2000/02/08)<br>
-<a href="pywiki?FindPage&value=TestPage">FindPage</a> by browsing or searching<br>
+<p> Please discuss <a href="pywiki?TestPage">TestPage</a> here. <hr>
+<p><a href="pywiki?edit=TestPage">EditText</a> of this page
+(last edited 2002/02/03)<br>
+<a href="pywiki?FindPage&amp;value=TestPage">FindPage</a> by browsing or searching<br>
 <a href="pywiki?notification=TestPage">SubscribeForChangeNotification</a> via email for this page (or unsubscribe)<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gpe.test.out.ref pywiki/testfiles/cgievents.gpe.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gpe.test.out.ref	Tue Feb  8 16:11:03 2000
+++ pywiki/testfiles/cgievents.gpe.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,28 +1,32 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Edit TestPage</title></head>
 <body><form method="POST" action="pywiki">
 <h1>TestPage <input type="submit" value=" Save ">
 <input type="reset" value=" Reset "></h1>
-<TEXTAREA NAME="text" ROWS=18 COLS=80 wrap=virtual>Please discuss TestPage here.</TEXTAREA><br>
+<p>
+<TEXTAREA NAME="text" ROWS=18 COLS=80>Please discuss TestPage here.</TEXTAREA><br>
 <input type="checkbox" name="convert" value="off" >
 I can't type tabs.
 Please <a href="pywiki?ConvertSpacesToTabs">ConvertSpacesToTabs</a>
 for me when I save.<p>
 <h1>Links</h1>
+<p>
 [1] <input type="text" size=55 name="r1" value=""><br>
 [2] <input type="text" size=55 name="r2" value=""><br>
 [3] <input type="text" size=55 name="r3" value=""><br>
 [4] <input type="text" size=55 name="r4" value=""><p>
 Type the full URL (http:// ...) for each reference cited in the text.<p>
 <a href="pywiki?GoodStyle">GoodStyle</a> tips for editing.<br>
-<a href="pywiki?rows=12&cols=60&edit=TestPage">EditPage</a> using a smaller text area.<br>
+<a href="pywiki?rows=12&amp;cols=60&amp;edit=TestPage">EditPage</a> using a smaller text area.<br>
 <a href="pywiki?copy=TestPage">EditCopy</a> from earlier revision.<br>
 <input type="hidden" size=1 name="text_edit" value="yes">
 <input type="hidden" size=1 name="page_name" value="TestPage">
 <input type="hidden" size=1 name="rev" value="">
-<input type="hidden" size=1 name="tip_date_time" value="2000/02/08 23:11:03">
+<input type="hidden" size=1 name="tip_date_time" value="2002/02/03 20:09:34">
 </form>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gpene.test.out.ref pywiki/testfiles/cgievents.gpene.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gpene.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.gpene.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,23 +1,27 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Edit NonExistPage</title></head>
 <body><form method="POST" action="pywiki">
 <h1>NonExistPage <input type="submit" value=" Save ">
 <input type="reset" value=" Reset "></h1>
-<TEXTAREA NAME="text" ROWS=18 COLS=80 wrap=virtual>Discuss NonExistPage here.</TEXTAREA><br>
+<p>
+<TEXTAREA NAME="text" ROWS=18 COLS=80>Discuss NonExistPage here.</TEXTAREA><br>
 <input type="checkbox" name="convert" value="off" >
 I can't type tabs.
 Please <a href="pywiki?ConvertSpacesToTabs">ConvertSpacesToTabs</a>
 for me when I save.<p>
 <h1>Links</h1>
+<p>
 [1] <input type="text" size=55 name="r1" value=""><br>
 [2] <input type="text" size=55 name="r2" value=""><br>
 [3] <input type="text" size=55 name="r3" value=""><br>
 [4] <input type="text" size=55 name="r4" value=""><p>
 Type the full URL (http:// ...) for each reference cited in the text.<p>
 <a href="pywiki?GoodStyle">GoodStyle</a> tips for editing.<br>
-<a href="pywiki?rows=12&cols=60&edit=NonExistPage">EditPage</a> using a smaller text area.<br>
+<a href="pywiki?rows=12&amp;cols=60&amp;edit=NonExistPage">EditPage</a> using a smaller text area.<br>
 <a href="pywiki?copy=NonExistPage">EditCopy</a> from earlier revision.<br>
 <input type="hidden" size=1 name="text_edit" value="yes">
 <input type="hidden" size=1 name="page_name" value="NonExistPage">
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gper.test.out.ref pywiki/testfiles/cgievents.gper.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gper.test.out.ref	Tue Feb  8 16:11:10 2000
+++ pywiki/testfiles/cgievents.gper.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,29 +1,33 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Edit TestPage</title></head>
 <body><form method="POST" action="pywiki">
 <h1>TestPage <input type="submit" value=" Save ">
 <input type="reset" value=" Reset "></h1>
-<TEXTAREA NAME="text" ROWS=18 COLS=80 wrap=virtual>Please discuss TestPage here.</TEXTAREA><br>
+<p>
+<TEXTAREA NAME="text" ROWS=18 COLS=80>Please discuss TestPage here.</TEXTAREA><br>
 <input type="checkbox" name="convert" value="off" >
 I can't type tabs.
 Please <a href="pywiki?ConvertSpacesToTabs">ConvertSpacesToTabs</a>
 for me when I save.<p>
 <h1>Links</h1>
+<p>
 [1] <input type="text" size=55 name="r1" value=""><br>
 [2] <input type="text" size=55 name="r2" value=""><br>
 [3] <input type="text" size=55 name="r3" value=""><br>
 [4] <input type="text" size=55 name="r4" value=""><p>
 Type the full URL (http:// ...) for each reference cited in the text.<p>
 <a href="pywiki?GoodStyle">GoodStyle</a> tips for editing.<br>
-<a href="pywiki?rows=12&cols=60&edit=TestPage&rev=1.1">EditPage</a> using a smaller text area.<br>
+<a href="pywiki?rows=12&amp;cols=60&amp;edit=TestPage&amp;rev=1.1">EditPage</a> using a smaller text area.<br>
 <a href="pywiki?copy=TestPage">EditCopy</a> from earlier revision.<br>
 <p><b>Editing copy. This is not the current revision!</b><br>
 <input type="hidden" size=1 name="text_edit" value="yes">
 <input type="hidden" size=1 name="page_name" value="TestPage">
 <input type="hidden" size=1 name="rev" value="1.1">
-<input type="hidden" size=1 name="tip_date_time" value="2000/02/08 23:11:10">
+<input type="hidden" size=1 name="tip_date_time" value="2002/02/03 20:09:39">
 </form>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gpez.test.out.ref pywiki/testfiles/cgievents.gpez.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gpez.test.out.ref	Tue Feb  8 16:11:06 2000
+++ pywiki/testfiles/cgievents.gpez.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,28 +1,32 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Edit TestPage</title></head>
 <body><form method="POST" action="pywiki">
 <h1>TestPage <input type="submit" value=" Save ">
 <input type="reset" value=" Reset "></h1>
-<TEXTAREA NAME="text" ROWS=9 COLS=40 wrap=virtual>Please discuss TestPage here.</TEXTAREA><br>
+<p>
+<TEXTAREA NAME="text" ROWS=9 COLS=40>Please discuss TestPage here.</TEXTAREA><br>
 <input type="checkbox" name="convert" value="off" >
 I can't type tabs.
 Please <a href="pywiki?ConvertSpacesToTabs">ConvertSpacesToTabs</a>
 for me when I save.<p>
 <h1>Links</h1>
+<p>
 [1] <input type="text" size=55 name="r1" value=""><br>
 [2] <input type="text" size=55 name="r2" value=""><br>
 [3] <input type="text" size=55 name="r3" value=""><br>
 [4] <input type="text" size=55 name="r4" value=""><p>
 Type the full URL (http:// ...) for each reference cited in the text.<p>
 <a href="pywiki?GoodStyle">GoodStyle</a> tips for editing.<br>
-<a href="pywiki?rows=12&cols=60&edit=TestPage">EditPage</a> using a smaller text area.<br>
+<a href="pywiki?rows=12&amp;cols=60&amp;edit=TestPage">EditPage</a> using a smaller text area.<br>
 <a href="pywiki?copy=TestPage">EditCopy</a> from earlier revision.<br>
 <input type="hidden" size=1 name="text_edit" value="yes">
 <input type="hidden" size=1 name="page_name" value="TestPage">
 <input type="hidden" size=1 name="rev" value="">
-<input type="hidden" size=1 name="tip_date_time" value="2000/02/08 23:11:06">
+<input type="hidden" size=1 name="tip_date_time" value="2002/02/03 20:09:36">
 </form>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.gps.test.out.ref pywiki/testfiles/cgievents.gps.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.gps.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.gps.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,24 +1,26 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>TestPage</title></head>
-<body><h1><img src="/pywiki.gif">
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
 <a href="pywiki?search=TestPage">TestPage</a></h1>
-<form>
-This first part is some normal text. It should be rendered
+<p> This first part is some normal text. It should be rendered
 by the browser to best fit the page. Here's some
 <strong>strong emphasis (surrounded by 3 single quotes)</strong>
 and <em>normal emphasis (surrounded by 2 single quotes).</em> Here's a
 horizontal rule
-<hr> and an InternalLink<a href="pywiki?InternalLink">?</a>.
+<hr><p> and an InternalLink<a href="pywiki?InternalLink">?</a>.
 <p> <PRE>
  This new paragraph should be rendered as preformatted text. This section has
  the same elements as the last, that is:  Here's some
  <strong>strong emphasis (surrounded by 3 single quotes)</strong>
  and <em>normal emphasis (surrounded by 2 single quotes).</em>
  InternalLinks<a href="pywiki?InternalLinks">?</a> are supported.
-<p> </PRE>
-This isn't really a validWikiName is it? HowAboutThis1? SurelyNot_this.
+</PRE>
+<p> This isn't really a validWikiName is it? HowAboutThis1? SurelyNot_this.
 totallyBogusWikiName
 <p> <a href="pywiki?TestPage">TestPage</a> link should be resolved.
 <em><a href="pywiki?TestPage">TestPage</a></em> link should be resolved.
@@ -54,28 +56,27 @@
 </DL><UL>
 <li> in turn nested in this unordered list.
 <li> which has 2 items.
-<p> </UL>
-A search field can be provided: <p><form><input type="text" size="40" name="search" value="search string"></form><p>
+</UL>
+<p> A search field can be provided: <form action="pywiki"><p><input type="text" size="40" name="search" value="search string"></form><p>
 [1]
 <a href="http://www.noname.com">http://www.noname.com</a>[2]
 <a href="ftp://www.notaname.com">ftp://www.notaname.com</a>?
 <a href="mailto:goofy@pluto.com">mailto:goofy@pluto.com</a>(mail me!)
 <a href="news:comp.lang.python">news:comp.lang.python</a>
 goodnews:blablabla.lang.piglatin
-<a href="http://www.dubdubdub.org">http://www.dubdubdub.org</a>&ltopt&gt
+<a href="http://www.dubdubdub.org">http://www.dubdubdub.org</a>&lt;opt&gt;
 <a href="http://www.dubdubdub.org/cgi-bin/pywiki?RecentChanges">http://www.dubdubdub.org/cgi-bin/pywiki?RecentChanges</a>
-<img src="http://www.python.org/snake.gif">
-<img src="http://www.python.org/snake.jpg">
-Oh no! <img src="http://www.python.org/snake.png">
+<img src="http://www.python.org/snake.gif" alt="embedded image">
+<img src="http://www.python.org/snake.jpg" alt="embedded image">
+Oh no! <img src="http://www.python.org/snake.png" alt="embedded image">
 thisissobogushttp://www.dubdubdub.com
 <PRE>
         boySoIsThishttp://www.dubdubdub.com
 </PRE>
-</form>
 <hr>
-<a href="pywiki?edit=TestPage">EditText</a> of this page
-(last edited 2000/02/08)<br>
-<a href="pywiki?FindPage&value=TestPage">FindPage</a> by browsing or searching<br>
+<p><a href="pywiki?edit=TestPage">EditText</a> of this page
+(last edited 2002/02/03)<br>
+<a href="pywiki?FindPage&amp;value=TestPage">FindPage</a> by browsing or searching<br>
 <a href="pywiki?notification=TestPage">SubscribeForChangeNotification</a> via email for this page (or unsubscribe)<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.pan.test.out.ref pywiki/testfiles/cgievents.pan.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.pan.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.pan.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,8 +1,10 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Notifications for TestPage Changed</title></head>
 <body><h1>Notifications for TestPage Changed</h1>
-Notification will be sent to tim@localhost when <a href="pywiki?TestPage">TestPage</a> is changed.<br>
+<p>Notification will be sent to tim@localhost when <a href="pywiki?TestPage">TestPage</a> is changed.<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.pdn.test.out.ref pywiki/testfiles/cgievents.pdn.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.pdn.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.pdn.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,8 +1,10 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Notifications for TestPage Changed</title></head>
 <body><h1>Notifications for TestPage Changed</h1>
-Notification will no longer be sent to tim@localhost when <a href="pywiki?TestPage">TestPage</a> is changed.<br>
+<p>Notification will no longer be sent to tim@localhost when <a href="pywiki?TestPage">TestPage</a> is changed.<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.pdnen.test.out.ref pywiki/testfiles/cgievents.pdnen.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.pdnen.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.pdnen.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,9 +1,11 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title>Unsubscription Error</title></head>
 <body><h1>Unsubscription Error</h1>
-tim@localhost is not subscribed for notifications on TestPage.
 <p>
+tim@localhost is not subscribed for notifications on TestPage.
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.pt.test.out.ref pywiki/testfiles/cgievents.pt.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.pt.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.pt.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,9 +1,11 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
-<head><title>Thanks for TestPage Edits</title></head><body>
+<head><title>Thanks for TestPage Edits</title></head>
 <body><h1>Thanks for editing TestPage.</h1>
-Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
+<p>Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
 p.s. Be sure to <em>Reload</em> your old pages.<br>
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.ptc.test.out pywiki/testfiles/cgievents.ptc.test.out
--- pywiki-0.4.2/testfiles/cgievents.ptc.test.out	Tue Feb  8 16:11:01 2000
+++ pywiki/testfiles/cgievents.ptc.test.out	Wed Dec 31 17:00:00 1969
@@ -1,18 +0,0 @@
-Content-type: text/html
-
-<html>
-<head><title>Thanks for TestPage Edits</title></head><body>
-<body><h1>Thanks for editing TestPage.</h1>
-Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
-p.s. Be sure to <em>Reload</em> your old pages.<br>
-</body>
-</html>
-Content-type: text/html
-
-<html>
-<head><title>Editing Conflict</title></head>
-<body><h1>Editing Conflict</h1>
-Another author has modified this page since you checked it out. So that you won't interfere with the other author's work, you need to reload, re-edit, and submit again. Sorry!
-<p>
-</body>
-</html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.ptc.test.out.ref pywiki/testfiles/cgievents.ptc.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.ptc.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.ptc.test.out.ref	Wed Dec 31 17:00:00 1969
@@ -1,18 +0,0 @@
-Content-type: text/html
-
-<html>
-<head><title>Thanks for TestPage Edits</title></head><body>
-<body><h1>Thanks for editing TestPage.</h1>
-Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
-p.s. Be sure to <em>Reload</em> your old pages.<br>
-</body>
-</html>
-Content-type: text/html
-
-<html>
-<head><title>Editing Conflict</title></head>
-<body><h1>Editing Conflict</h1>
-Another author has modified this page since you checked it out. So that you won't interfere with the other author's work, you need to reload, re-edit, and submit again. Sorry!
-<p>
-</body>
-</html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.ptc1.test.out.ref pywiki/testfiles/cgievents.ptc1.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.ptc1.test.out.ref	Wed Dec 31 17:00:00 1969
+++ pywiki/testfiles/cgievents.ptc1.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -0,0 +1,11 @@
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head><title>Thanks for TestPage Edits</title></head>
+<body><h1>Thanks for editing TestPage.</h1>
+<p>Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
+p.s. Be sure to <em>Reload</em> your old pages.<br>
+</body>
+</html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.ptc2.test.out.ref pywiki/testfiles/cgievents.ptc2.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.ptc2.test.out.ref	Wed Dec 31 17:00:00 1969
+++ pywiki/testfiles/cgievents.ptc2.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -0,0 +1,11 @@
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head><title>Editing Conflict</title></head>
+<body><h1>Editing Conflict</h1>
+<p>
+Another author has modified this page since you checked it out. So that you won't interfere with the other author's work, you need to reload, re-edit, and submit again. Sorry!
+</body>
+</html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.srche.test.out.ref pywiki/testfiles/cgievents.srche.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.srche.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.srche.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,10 +1,15 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title> Search for nTerna</title></head>
-<body><h1><img src="/pywiki.gif"> SearchResults</h1>
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
+SearchResults</h1>
+<p>
 <a href="pywiki?TestPage">TestPage</a> . . . . . .  InternalLink<br>
 <hr>
-1 pages found out of 1 pages searched.
+<p>1 pages found out of 1 pages searched.
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.srchw.test.out.ref pywiki/testfiles/cgievents.srchw.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.srchw.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.srchw.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,10 +1,15 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head><title> Search for best</title></head>
-<body><h1><img src="/pywiki.gif"> SearchResults</h1>
+<body><h1>
+<img src="/pywiki.gif" alt="PyWiki Logo">
+SearchResults</h1>
+<p>
 <a href="pywiki?TestPage">TestPage</a> . . . . . .  best<br>
 <hr>
-1 pages found out of 1 pages searched.
+<p>1 pages found out of 1 pages searched.
 </body>
 </html>
diff -r -u -N pywiki-0.4.2/testfiles/cgievents.ttc.test.out.ref pywiki/testfiles/cgievents.ttc.test.out.ref
--- pywiki-0.4.2/testfiles/cgievents.ttc.test.out.ref	Tue Feb  8 16:10:55 2000
+++ pywiki/testfiles/cgievents.ttc.test.out.ref	Sun Feb  3 22:41:31 2002
@@ -1,9 +1,11 @@
 Content-type: text/html
 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                      "http://www.w3.org/TR/html4/strict.dtd">
 <html>
-<head><title>Thanks for TestPage Edits</title></head><body>
+<head><title>Thanks for TestPage Edits</title></head>
 <body><h1>Thanks for editing TestPage.</h1>
-Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
+<p>Thank you for editing <a href="pywiki?TestPage">TestPage</a>.<br>
 p.s. Be sure to <em>Reload</em> your old pages.<br>
 </body>
 </html>
