image_path,image_url = self._thumb(image, **kwargs)
else:
image_url = image
- return '<img src="{}" />'.format(image_url)
+ sections = ['<img src="{}"'.format(image_url)]
+ caption = self._get_image_caption(path=image)
+ if caption:
+ caption = _xml_sax_saxutils.quoteattr(
+ caption.replace('\n', ' ').strip())
+ sections.extend([
+ 'title={}'.format(caption),
+ 'alt={}'.format(caption),
+ ])
+ sections.append('/>')
+ return ' '.join(sections)
def _image_page(self, image):
return image_base(image) + '/'