diff MoinMoin/formatter/text_html.py @ 563:dde3d1b2a9d4

change p generation from self-closing to auto-closing, add \n before table for gui converter imported from: moin--main--1.5--patch-567
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 15 Apr 2006 13:10:51 +0000
parents d827734692ac
children 6c572f52899f
line wrap: on
line diff
--- a/MoinMoin/formatter/text_html.py	Fri Apr 14 15:35:52 2006 +0000
+++ b/MoinMoin/formatter/text_html.py	Sat Apr 15 13:10:51 2006 +0000
@@ -27,7 +27,10 @@
 # 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', 'p'])
+                          'isindex', 'link', 'meta', 'param'])
+
+# We only open those tags and let the browser auto-close them:
+_auto_closing_tags = Set(['p'])
 
 # These are the elements which generally should cause an increase in the
 # indention level in the html souce code.
@@ -326,10 +329,8 @@
         @rtype: string ?
         @return: open tag with attributes as a string
         """
-        is_self_closing = ''
-        if tag in _self_closing_tags:
-            # Don't expect a closing tag later on.
-            is_self_closing = ' /'
+        # If it is self-closing, then don't expect a closing tag later on.
+        is_self_closing = (tag in _self_closing_tags) and ' /' or ''
 
         if tag in _blocks:
             # Block elements
@@ -371,7 +372,7 @@
         @rtype: string
         @return: closing tag as a string
         """
-        if tag in _self_closing_tags:
+        if tag in _self_closing_tags or tag in _auto_closing_tags:
             # This tag was already closed
             tagstr = ''
         elif tag in _blocks: