diff --git a/ponyconf/utils.py b/ponyconf/utils.py index 151033b..1c6f8b0 100644 --- a/ponyconf/utils.py +++ b/ponyconf/utils.py @@ -16,6 +16,7 @@ class PonyConfModel(models.Model): def markdown_to_html(md): html = markdown(md) - allowed_tags = bleach.ALLOWED_TAGS + ['p', 'pre', 'span' ] + ['h%d' % i for i in range(1, 7) ] - html = bleach.clean(html, tags=allowed_tags) + allowed_tags = bleach.ALLOWED_TAGS + ['p', 'pre', 'span', 'img'] + ['h%d' % i for i in range(1, 7) ] + allowed_attributes = bleach.ALLOWED_ATTRIBUTES['img'] = ['src', 'alt'] + html = bleach.clean(html, tags=allowed_tags, attributes=allowed_attributes) return mark_safe(html)