changeset 1226:5624136549ab

merged
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 09 Jan 2012 01:57:49 +0100
parents e3df544da406 (current diff) 63d51e0ddc47 (diff)
children 4899314f049a
files
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sun Jan 08 20:55:32 2012 +0100
+++ b/MoinMoin/items/__init__.py	Mon Jan 09 01:57:49 2012 +0100
@@ -287,7 +287,14 @@
         flaskg.clock.start('conv_dom_html')
         doc = html_conv(doc)
         flaskg.clock.stop('conv_dom_html')
-        return conv_serialize(doc, {html.namespace: ''})
+        rendered_data = conv_serialize(doc, {html.namespace: ''})
+        # This is a work-around to avoid the invalid <div /> tag from being passed
+        # and causing layout issues in many browsers
+        # Instead, send a <div></div> tag which is valid according to the HTML spec
+        # The wider issue with serialization is covered here:
+        # https://bitbucket.org/thomaswaldmann/moin-2.0/issue/145/xml-mode-serialization-returns-self
+        return "<div></div>" if rendered_data == "<div xmlns=\"http://www.w3.org/1999/xhtml\" />" \
+                             else rendered_data
 
     def _render_data_xml(self):
         doc = self.internal_representation()