Skip to content

Commit

Permalink
fix(markdown): handle inline image conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
icelam committed Dec 12, 2021
1 parent 7403e18 commit 09b7330
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/utils/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ class TelegramMarkdownConverter(MarkdownConverter):

def convert_img(self, el, text, convert_as_inline):
src = el.attrs.get('src', None) or ''
return f'Image: [{src}]({src})'

if convert_as_inline:
return f'(Image: [{src}]({src}))'

return f'\nImage: [{src}]({src})\n'

def convert_br(self, el, text, convert_as_inline):
if convert_as_inline:
Expand Down

0 comments on commit 09b7330

Please sign in to comment.