Commits

Roger Haase committed 6c8c378

fix for 279 ReST page results in 500 error when transcluding any image

  • Participants
  • Parent commits 42d4f77

Comments (0)

Files changed (1)

MoinMoin/converter/rst_in.py

 
 from MoinMoin import config
 from MoinMoin.util.iri import Iri
-from MoinMoin.util.tree import html, moin_page, xlink
+from MoinMoin.util.tree import html, moin_page, xlink, xinclude
 
 from ._util import allowed_uri_scheme, decode_data, normalize_split_text
 
         pass
 
     def visit_image(self, node):
-        new_node = moin_page.object(attrib={xlink.href: node['uri']})
+        target = Iri(scheme='wiki.local', path=node['uri'])
+        attrib = {xinclude.href: target}
+        new_node = xinclude.include(attrib=attrib)
         # TODO: rewrite this more compact
         alt = node.get('alt', None)
         if alt: