changeset 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 1cd94e567b46
children a7f8bfd10322
files ChangeLog MoinMoin/converter/text_html_text_x_moin.py MoinMoin/formatter/text_html.py docs/CHANGES
diffstat 4 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 14 15:35:52 2006 +0000
+++ b/ChangeLog	Sat Apr 15 13:10:51 2006 +0000
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-04-15 14:10:51 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-567
+
+    Summary:
+      change p generation from self-closing to auto-closing, add \n before table for gui converter
+    Revision:
+      moin--main--1.5--patch-567
+
+    change p generation from self-closing to auto-closing, add \n before table for gui converter
+    
+
+    modified files:
+     ChangeLog MoinMoin/converter/text_html_text_x_moin.py
+     MoinMoin/formatter/text_html.py docs/CHANGES
+
+
 2006-04-14 16:35:52 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-566
 
     Summary:
--- a/MoinMoin/converter/text_html_text_x_moin.py	Fri Apr 14 15:35:52 2006 +0000
+++ b/MoinMoin/converter/text_html_text_x_moin.py	Sat Apr 15 13:10:51 2006 +0000
@@ -961,6 +961,8 @@
         return " ".join(result).strip()
 
     def process_table(self, node, style=""):
+        if self.text[-1].strip(' ') != "\n":
+            self.text.append("\n")
         self.new_table = True
         style += self._table_style(node)
         for i in node.childNodes:
--- 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:
--- a/docs/CHANGES	Fri Apr 14 15:35:52 2006 +0000
+++ b/docs/CHANGES	Sat Apr 15 13:10:51 2006 +0000
@@ -43,6 +43,9 @@
     * Fixed sslclientcert auth.
     * Added some missing files to i18n processing, translatable strings more
       complete now.
+    * Change <p> generation from self-closing (<p />) to auto-closing (only
+      emit <p>, let browser find place for </p>).
+    * Fix eating of newline before tables.
 
   Other Changes:
     * We catch and ignore html to wiki conversion errors in case of hitting