changeset 525:66c0297e3fd0

make <p> self-closing, line-anchors more well-behaved imported from: moin--main--1.5--patch-529
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 07 Apr 2006 16:33:31 +0000
parents 357fae7da0e5
children d0dba03190b6
files ChangeLog MoinMoin/formatter/text_html.py MoinMoin/parser/wiki.py docs/CHANGES
diffstat 4 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Apr 06 17:43:34 2006 +0000
+++ b/ChangeLog	Fri Apr 07 16:33:31 2006 +0000
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-04-07 17:33:31 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-529
+
+    Summary:
+      make <p> self-closing, line-anchors more well-behaved
+    Revision:
+      moin--main--1.5--patch-529
+
+    make <p> self-closing, line-anchors more well-behaved
+    
+
+    modified files:
+     ChangeLog MoinMoin/formatter/text_html.py
+     MoinMoin/parser/wiki.py docs/CHANGES
+
+
 2006-04-06 18:43:34 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-528
 
     Summary:
--- a/MoinMoin/formatter/text_html.py	Thu Apr 06 17:43:34 2006 +0000
+++ b/MoinMoin/formatter/text_html.py	Fri Apr 07 16:33:31 2006 +0000
@@ -27,7 +27,7 @@
 # when they don't have a closing tag even if valid XHTML.
 
 _self_closing_tags = Set(['area', 'base', 'br', 'col', 'frame', 'hr', 'img', 'input',
-                          'isindex', 'link', 'meta', 'param'])
+                          'isindex', 'link', 'meta', 'param', 'p'])
 
 # These are the elements which generally should cause an increase in the
 # indention level in the html souce code.
--- a/MoinMoin/parser/wiki.py	Thu Apr 06 17:43:34 2006 +0000
+++ b/MoinMoin/parser/wiki.py	Fri Apr 07 16:33:31 2006 +0000
@@ -731,6 +731,7 @@
 
             # return the complete cell markup
             result.append(self.formatter.table_cell(1, attrs) + attrerr)         
+            result.append(self._line_anchordef())
             return ''.join(result) 
         else:
             return self.formatter.text(word)
@@ -902,6 +903,13 @@
 
         return ""
 
+    def _line_anchordef(self):
+        if self.line_anchors and not self.line_anchor_printed:
+            self.line_anchor_printed = 1
+            return self.formatter.line_anchordef(self.lineno)
+        else:
+            return ''
+
     def format(self, formatter):
         """ For each line, scan through looking for magic
             strings, outputting verbatim any intervening text.
@@ -937,8 +945,9 @@
         # Main loop
         for line in self.lines:
             self.lineno += 1
-            if self.line_anchors:
-                self.request.write(self.formatter.line_anchordef(self.lineno))
+            self.line_anchor_printed = 0
+            if not self.in_table:
+                self.request.write(self._line_anchordef())
             self.table_rowstart = 1
             self.line_was_empty = self.line_is_empty
             self.line_is_empty = 0
@@ -1012,6 +1021,7 @@
                 if not line.strip():
                     if self.in_table:
                         self.request.write(self.formatter.table(0))
+                        self.request.write(self._line_anchordef())
                         self.in_table = 0
                     # CHANGE: removed check for not self.list_types
                     # p should close on every empty line
@@ -1073,6 +1083,7 @@
                     
                     # Close table
                     self.request.write(self.formatter.table(0))
+                    self.request.write(self._line_anchordef())
                     self.in_table = 0
                                             
             # Scan line, format and write
--- a/docs/CHANGES	Thu Apr 06 17:43:34 2006 +0000
+++ b/docs/CHANGES	Fri Apr 07 16:33:31 2006 +0000
@@ -47,6 +47,9 @@
     * Fixed XSS issue which could lead to cookie theft etc.
     * Fixed definition list "same level" indenting.
     * Fixed pagename in log for PackagePages action.
+    * made <p> self-closing and line-anchors more well-behaved, thanks to
+      Martin Wilck for the patch. I didn't apply the <ol> patch, because this
+      is no real problem, just a problem of a bad standard.
 
   Other changes:
     * moved back UserPreferences action link from menu to top of page (renaming