changeset 1721:65bf1618c196

gui converter, ImageLink: check width/height before generating ImageLink
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 07 Jan 2007 23:08:59 +0100
parents 8a0c277a20f7
children 366650d8772b
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Sun Jan 07 22:55:26 2007 +0100
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Sun Jan 07 23:08:59 2007 +0100
@@ -1201,10 +1201,13 @@
                 il_parms = "%s" % wikiutil.url_unquote(title[len("attachment:"):])
                 if target is not None:
                     il_parms += ",%s" % target
-                il_kws = "width=%s,height=%s" % (width, height)
-                if alt:
-                    il_kws += ",alt=%s" % alt
-                self.text.extend([self.white_space, "[[ImageLink(%s,%s)]]" % (il_parms, il_kws), self.white_space])
+                if width is not None:
+                    il_parms += ",width=%s" % width
+                if height is not None:
+                    il_parms += ",height=%s" % height
+                if alt is not None:
+                    il_parms += ",alt=%s" % alt
+                self.text.extend([self.white_space, "[[ImageLink(%s)]]" % il_parms, self.white_space])
 
         # Drawing image
         elif title and title.startswith("drawing:"):