Skip to main content
Question

Slack not displaying formatted markdown messages

  • October 14, 2024
  • 4 replies
  • 688 views

Hi everyone,

I've been using a Zap to convert an HTML message to Markdown to post in Slack. Previously, this setup worked perfectly, and the messages in Slack were formatted correctly. However, recently, the Slack messages have not been formatting correctly.

Here are the steps my Zap follows:

  1. Convert the message from HTML to Markdown.
  2. Post the Markdown message to Slack.

Could anyone help me figure out why the formatting might have broken recently or suggest any adjustments to fix this issue? Any insights or tips would be greatly appreciated!

Thank you!

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • October 14, 2024

Hi @InfoTSCFO 

For us to have more info, post screenshots showing how your Zap steps are outlined and configured in EDIT mode.


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • October 15, 2024

Hi there @InfoTSCFO,

Just giving a quick nudge here. Could you please send screenshots of your Zap setup? Especially the “Configure” section of the Slack action step so that we can take a closer look.

Thanks!


  • Author
  • New
  • October 15, 2024

Hi,

 

I attached images of steps where text is converted from HTML to Markdown (Step_5) and where the message is sent in slack (Step_6)

 


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • October 16, 2024

Thanks for the screenshots @InfoTSCFO!

I did some digging into our notes, and it seems like Slack Markdown slightly differs from Standard Markdown, making it so using a Formatter step to convert markdown to HTML doesn't always work, especially when it comes to hyperlinks.

A Code step with Javascript can be used to convert Slack Markdown to Standard Markdown first.

A customer shared the following script that worked for them:

var slackMessage = inputData.slackMsg; const regex = /<(https?:\/\/[\w-]+(?:\.[\w]+)+(?:\/[\w?=%&@$#\~\-_.+]+)*\/?)(?:\|((?:[^>])+))?>/g; var result = slackMessage.replace(regex, ($2)); output = { result };

Hopefully, this helps.