sudoskys / telegramify-markdown

🪄 Markdown To Telegram Markdown Converter Python| No more worrying about formatting.
MIT License
48 stars 4 forks source link

Correct Stron Rendering #6

Closed yelboudouri closed 4 months ago

yelboudouri commented 4 months ago

Telegram bold text is defined by *text*, while Markdown bold text is defined by **text** or __text__ [ref]. Therefore, both **text** and __text__ should be converted to *text*.

sudoskys commented 4 months ago

what about underline?

yelboudouri commented 4 months ago

Markdown doesn't support underline text.

sudoskys commented 4 months ago

I think we need to add a setting constant to specify whether to strictly follow the Markdown specification, because sometimes, such as when used by bots, it will be troublesome not to be able to make a Telegram supported underline. I hope to be able to do both.

sudoskys commented 4 months ago

But this library should follow the markdown specification by default. I will improve the follow-up work and release a new version.

Thank you for your contribution

yelboudouri commented 4 months ago

This is a message rendered by the old code.

photo_2024-05-25_13-51-11

You see, it says 'bold text' but it's underlined. I think it should be kept this way because if a bot wants to render an underline, they have to include it directly in their message. This library is made to convert Markdown to MarkdownV2. I have a small idea: to make use of underline in other contexts, for example in headings.

sudoskys commented 4 months ago

I made a compatibility improvement: https://github.com/sudoskys/telegramify-markdown/pull/7 I think it can solve this problem