Repository navigation
feat: render markdown tables as space-aligned code blocks - #11
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Markdown pipe tables now convert to a space-aligned block inside the existing code fence, instead of keeping the raw pipe syntax:
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
SLACK-22(aligned table), pinnedHTML-08and the inline asserts intest.tsupdated in the same committsc --noEmit,node test.tsandnode evals/check.ts(44/44) all pass