Member Junction
    Preparing search index...
    • Convert Markdown text from an agent response to Slack Block Kit blocks.

      Handles:

      • ATX headers → Block Kit header blocks
      • Fenced code blocks → section blocks with triple backtick wrapping
      • Paragraphs → section blocks with mrkdwn formatting
      • Long text → auto-split into multiple blocks to respect the 3000-char limit

      Parameters

      • markdown: string

        Raw Markdown text from an agent response.

      Returns Record<string, unknown>[]

      Array of Slack Block Kit block objects.

      const blocks = markdownToBlocks('# Hello\n\nThis is **bold** text.');
      // [
      // { type: 'header', text: { type: 'plain_text', text: 'Hello' } },
      // { type: 'section', text: { type: 'mrkdwn', text: 'This is *bold* text.' } }
      // ]