Skip to content

Commit 09b7330

Browse files
committed
fix(markdown): handle inline image conversion
1 parent 7403e18 commit 09b7330

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/utils/markdown.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ class TelegramMarkdownConverter(MarkdownConverter):
88

99
def convert_img(self, el, text, convert_as_inline):
1010
src = el.attrs.get('src', None) or ''
11-
return f'Image: [{src}]({src})'
11+
12+
if convert_as_inline:
13+
return f'(Image: [{src}]({src}))'
14+
15+
return f'\nImage: [{src}]({src})\n'
1216

1317
def convert_br(self, el, text, convert_as_inline):
1418
if convert_as_inline:

0 commit comments

Comments
 (0)