changeset 525:766d8ba45f84

macro.Image: return only for html formatter div container
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 07 May 2010 20:30:12 +0200
parents 1414a0d200ec
children 56cbdae11f25
files data/plugin/macro/Image.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/macro/Image.py	Fri Apr 23 23:31:42 2010 +0200
+++ b/data/plugin/macro/Image.py	Fri May 07 20:30:12 2010 +0200
@@ -263,6 +263,11 @@
         br_clear = '<br style="clear:%s;">' % clear
     if width != 9999:
         div_width = '<div style="width:%spx">' % width
+
+    module = macro.formatter.__module__
+    if module[module.rfind('.') + 1:] != "text_html":
+        return macro.formatter.image(src=img.url((width, height)), alt=img.caption)
+
     return """<div class="thumbnail">%s<div class="decription">%s%s
               <div class="show-datetime">%s</div></div></div>%s""" % (
                                      macro.formatter.image(src=img.url((width, height)), alt=img.caption),