Commits

Julian Brost committed fde0a16

Marked output of the _render_data and _render_data_diff methods of some Item subclasses as Markup.

  • Participants
  • Parent commits 181ae3f

Comments (0)

Files changed (1)

MoinMoin/items/__init__.py

             # no PIL, we can't do anything, we just call the base class method
             return super(TransformableBitmapImage, self)._render_data_diff(oldrev, newrev)
         url = url_for('frontend.diffraw', item_name=self.name, rev1=oldrev.revno, rev2=newrev.revno)
-        return '<img src="%s" />' % escape(url) #HHH
+        return Markup('<img src="%s" />' % escape(url))
 
     def _render_data_diff_raw(self, oldrev, newrev):
         hash_name = app.cfg.hash_algorithm
             image_map = image_map.replace('%TWIKIDRAW%"', '%s" alt="%s" title="%s"' % (drawing_url, title, title))
             title = _('Clickable drawing: %(filename)s', filename=item_name)
 
-            return image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid) #HHH
+            return Markup(image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid))
         else:
-            return '<img src="%s" alt="%s" />' % (png_url, title) #HHH
+            return Markup('<img src="%s" alt="%s" />' % (png_url, title))
 
 class AnyWikiDraw(TarMixin, Image):
     """
             # unxml, because 4.01 concrete will not validate />
             image_map = image_map.replace(u'/>', u'>')
             title = _('Clickable drawing: %(filename)s', filename=self.name)
-            return image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid) #HHH
+            return Markup(image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid))
         else:
-            return '<img src="%s" alt="%s" />' % (png_url, title) #HHH
+            return Markup('<img src="%s" alt="%s" />' % (png_url, title))
 
 class SvgDraw(TarMixin, Image):
     """ drawings by svg-edit. It creates two files (svg, png) which are stored as tar file. """
         item_name = self.name
         drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg')
         png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png')
-        return '<img src="%s" alt="%s" />' % (png_url, drawing_url) #HHH
+        return Markup('<img src="%s" alt="%s" />' % (png_url, drawing_url))