changeset 1836:7f938234a924

eliminate double wrapping of transcluded svg items
author Roger Haase <crosseyedpenguin@yahoo.com>
date Sun, 07 Oct 2012 13:41:18 -0700
parents ee2eb7626c6f
children 7bfcad341121
files MoinMoin/converter/_tests/test_include.py MoinMoin/converter/html_out.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_include.py	Sat Oct 06 11:54:50 2012 -0700
+++ b/MoinMoin/converter/_tests/test_include.py	Sun Oct 07 13:41:18 2012 -0700
@@ -122,7 +122,7 @@
 
         update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{logo}}')
         rendered = Item.create(u'page1').content._render_data()
-        assert '<img alt="logo" class="moin-transclusion"' in rendered
+        assert '<div class="moin-transclusion" data-href="/logo"><img alt="logo"' in rendered
 
         # <p /> is not valid html5; should be <p></p>. to be valid.  Even better, there should be no empty p's.
         update_item(u'page1', {CONTENTTYPE: u'text/x.moin.wiki'}, u'{{logo}}{{logo}}')
--- a/MoinMoin/converter/html_out.py	Sat Oct 06 11:54:50 2012 -0700
+++ b/MoinMoin/converter/html_out.py	Sun Oct 07 13:41:18 2012 -0700
@@ -379,7 +379,10 @@
                 attrib[html.controls] = 'controls'
             new_elem = self.new_copy(getattr(html, obj_type), elem, attrib)
 
-        return mark_item_as_transclusion(new_elem, href)
+        if obj_type == "object" and href.scheme:
+            # items similar to {{http://moinmo.in}} are marked here, other objects are marked in include.py
+            return mark_item_as_transclusion(new_elem, href)
+        return new_elem
 
     def visit_moinpage_p(self, elem):
         return self.new_copy(html.p, elem)