Skip to content

feat: render markdown tables as space-aligned code blocks - #11

Merged
finnjanssens merged 1 commit into
mainfrom
feat/table-code-blocks
Sep 28, 2026
Merged

finnjanssens merged 1 commit into
mainfrom
feat/table-code-blocks

Conversation

@finnjanssens

@finnjanssens finnjanssens commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

What

Markdown pipe tables now convert to a space-aligned block inside the existing code fence, instead of keeping the raw pipe syntax:

Name      Role       Status
--------  ---------  --------
Alice     Developer  `active`
Bob | Jr  Away       no

Columns are padded to the widest cell, the separator row becomes dashes matching each column width, and \| in a cell keeps its literal pipe. The HTML flavour gets the same aligned content in <pre><code>.

Ref: https://macmdviewer.com/blog/slack-markdown-tables#how-do-you-create-a-slack-markdown-table-using-code-blocks

Tests

  • New eval row SLACK-22 (aligned table), pinned HTML-08 and the inline asserts in test.ts updated in the same commit
  • tsc --noEmit, node test.ts and node evals/check.ts (44/44) all pass

Slack mrkdwn has no table syntax, so strip the pipes, pad each column
to its widest cell and emit a dashed header separator inside the fence,
per the code-block workaround (macmdviewer.com/blog/slack-markdown-tables).

Closes the pipe-soup output the old verbatim fence produced.
@finnjanssens
finnjanssens merged commit dd683a1 into main Sep 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant