Permalink
Browse files

corrected alt tag behavior.

  • Loading branch information...
1 parent 3c2a1c4 commit a29be5d90b192e5b29b425b0de948d77da499ba3 @chrisdrackett chrisdrackett committed Aug 2, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 templatetags/charts.py
View
@@ -167,7 +167,11 @@ def img(self, color_override = None):
if orig_colors:
self.options['chco'] = orig_colors
width, height = self.options["chs"].split("x")
- s = mark_safe('<img src="%s" width="%s" height="%s" alt="%s" />' % (escape(url), width, height, escape(alt)))
+ if self.alt:
+ alt = '%s' % escape(self.alt)
+ else:
+ alt = ''
+ s = mark_safe('<img src="%s" width="%s" height="%s" alt="%s" />' % (escape(url), width, height, alt))
return s

0 comments on commit a29be5d

Please sign in to comment.