Skip to content

feat: add md_table helper for Markdown tables in templates - #1780

Open
ChrisJr404 wants to merge 1 commit into
errbotio:masterfrom
ChrisJr404:md-table-template-helper
Open

feat: add md_table helper for Markdown tables in templates#1780
ChrisJr404 wants to merge 1 commit into
errbotio:masterfrom
ChrisJr404:md-table-template-helper

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #935. Building a Markdown table from a Jinja2 template by hand is fiddly and easy to get wrong, so this adds an md_table helper that is available in every template. You give it the rows (an iterable of iterables) and optional headers, and it returns a valid Markdown table, escaping any pipe or newline characters in the cells so they don't break the layout.

Registered it as a global on the template environment, added a short note in the plugin messaging docs, and covered headers, the no-headers case, padding of short rows, and the escaping with tests.

@ChrisJr404
ChrisJr404 force-pushed the md-table-template-helper branch from 1fa6ade to e3ce9de Compare August 24, 2026 23:10
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.

Add a template function to generate tables in markdown

1 participant