Skip to content

Commit bb9259a

Browse files
authored
Merge pull request #6 from icelam/remove-style-tags
fix(markdown): strip style tags when converting html to markdown
2 parents 7480e42 + 480fcb9 commit bb9259a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/utils/markdown.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ def convert_a(self, el, text, convert_as_inline):
5555
convert_as_inline=convert_as_inline
5656
)
5757

58+
def convert_style(self, el, text, convert_as_inline):
59+
return ''
60+
5861
def generate(html, **options):
5962
"""Convert function with options predefined"""
6063

6164
result = TelegramMarkdownConverter(
6265
**options,
63-
convert=['br', 'p', 'img', 'code', 'pre', 'ul', 'ol', 'li', 'a', 'sup', 'sub'],
66+
convert=['br', 'p', 'img', 'code', 'pre', 'ul', 'ol', 'li', 'a', 'sup', 'sub', 'style'],
6467
bullets='•••'
6568
).convert(html).strip()
6669

0 commit comments

Comments
 (0)