Add many tests and support image tag

This commit is contained in:
Igor Dvorkin
2020-12-13 17:39:08 +00:00
parent 7780f82c30
commit 05ea8dc58a
2 changed files with 37 additions and 4 deletions

View File

@@ -229,6 +229,9 @@ class MarkdownConverter(object):
src = el.attrs.get('src', None) or ''
title = el.attrs.get('title', None) or ''
title_part = ' "%s"' % title.replace('"', r'\"') if title else ''
if convert_as_inline:
return alt
return '![%s](%s%s)' % (alt, src, title_part)