Skip to content

Feature: convert markdown tables to readable plain-text format #16

@mecampbellsoup

Description

@mecampbellsoup

Feature request

Slack's mrkdwn format doesn't support markdown table syntax (pipes and hyphens). Currently slackify-markdown passes table markup through verbatim, which renders poorly in Slack — the |---|---| separator row is visible and outer pipes add visual noise.

Current behavior

from slackify_markdown import slackify_markdown

md = """\
| Feature | Python | Go |
|---|---|---|
| Typing | Dynamic | Static |
"""
print(slackify_markdown(md))

Output (rendered in Slack as raw text):

| Feature | Python | Go |
|---|---|---|
| Typing | Dynamic | Static |

Desired behavior

Strip separator rows and outer pipes to produce clean pipe-delimited text:

Feature | Python | Go
Typing | Dynamic | Static

Optionally bold the header row cells (since they're typically <th> elements in the parsed AST):

*Feature* | *Python* | *Go*
Typing | Dynamic | Static

Context

Slack does support proper tables via Block Kit's table block, but that requires using the blocks API rather than plain text — most consumers of this library are converting markdown to a text string. The plain-text approach above is the best available rendering for that use case, and matches what other conversion libraries (e.g. markdown-to-mrkdwn) produce.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions