slack-ruby-client icon indicating copy to clipboard operation
slack-ruby-client copied to clipboard

chat_postMessage inline code block with >4000 symbols broken markdown

Open eslesarchuk opened this issue 6 years ago • 1 comments

I'm sending large inline code blocks into our slack rooms and blocks with more than 4000 symbols (roughly) are coming with a broken code style.

This message works fine:

"*test*\n```#{"x"*4000}```\n*test*"

This one came "broken":

"*test*\n```#{"x"*4100}```\n*test*"

It seems that the message is being split into two. I'm not quite sure whether it's a gem's issue or an API problem.

The doc https://api.slack.com/methods/chat.postMessage#formatting says

For best results, limit the number of characters in the text field to 4,000 characters. Ideally, messages should be short and human-readable. Slack will truncate messages containing more than 40,000 characters.

Messages are not truncated though, just split. Please guide where to look at. I'm using v0.14.1 at the moment.

eslesarchuk avatar Apr 02 '19 15:04 eslesarchuk

I am almost 100% sure this is an API problem, but I could be wrong. Maybe replicate it with curl and open a ticket with Slack and close this issue if that's the case?

dblock avatar Apr 02 '19 19:04 dblock