requilence / integram

Integrate Telegram into your workflow – Trello, Gitlab, Bitbucket and other bots
https://integram.org
GNU General Public License v3.0
1.54k stars 151 forks source link

Markdown format for gitlab messages #71

Open fauno opened 5 years ago

fauno commented 5 years ago

Hi, thanks for @gitlab_bot :)

I've noticed markdown-formated messages in Gitlab are rendered as plain text in Telegram bot messages, could you enable markdown? I don't know any Go to provide a patch

requilence commented 5 years ago

Hi @fauno!

I'm using HTML to pass the messages to Telegram to avoid accidentally broken markdown syntax. This way I will need to parse Gitlab's Markdown and transform into HTML allowed by Telegram Bot API. This is actually not a trivial task. I tried to use https://github.com/russross/blackfriday previously, but this turn into a mess and I omit it. I will take a look again when I will have a time

fauno commented 5 years ago

the bot api currently supports markdown, i think a stripped down version, but bold and links at least are supported

since i'm receiving markdown format from gitlab_bot i assumed that was what gitlab was sending to integram

-- .oÓ)

requilence commented 5 years ago

@fauno Unfortunately, I can't just pass raw Markdown from Gitlab into Telegram Bot API because this will break a lot of messages with unintended markdown characters etc. Telegram Bot API is very strict about it

fauno commented 5 years ago

ah! ok :)

-- :>