42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.6k stars 616 forks source link

Messages sent from Telegram incorrectly format strong emphasis #1770

Open haykam821 opened 2 years ago

haykam821 commented 2 years ago

CommonMark defines ** as indicating strong emphasis:

  1. A double ** can open strong emphasis iff it is part of a left-flanking delimiter run.

However, Matterbridge instead uses * to format strong emphasis in messages being sent from Telegram, which actually indicates normal emphasis alongside _:

https://github.com/42wim/matterbridge/blob/c5e49eec96a8b03786d679afa35c58952d0269a7/bridge/telegram/handlers.go#L523-L527

King-Mucus commented 2 years ago

Wouldn't it be optimal if Matterbridge converted all messages to HTML before relaying them? Making due adjustments for each platform for unsupported HTML tags, etc.? Do you think it would it add lag or take too much system resources?

We could convert unsupported tags to some custom markings, perhaps even configurable, on the various different platforms.