changeset 2552:6c8c3782cc18

fix for 279 ReST page results in 500 error when transcluding any image
author RogerHaase <haaserd@gmail.com>
date Wed, 15 Jan 2014 06:09:51 -0700
parents 42d4f773ca4a
children 67ae770a22d5
files MoinMoin/converter/rst_in.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/rst_in.py	Sun Jan 12 11:45:03 2014 -0700
+++ b/MoinMoin/converter/rst_in.py	Wed Jan 15 06:09:51 2014 -0700
@@ -27,7 +27,7 @@
 
 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
 
@@ -328,7 +328,9 @@
         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: