You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
table --theme markdown produces invalid markdown when $env.config.table.header_on_separator is set to true #13161
I would expect | table --theme markdown to produce a markdown output I can use on e.g. Github. However when $env.config.table.header_on_separator is set to true, the output is invalid:
|-#-|---------------------description---------------------|---soft----|---hard----|
| 0 | Maximum size of files created by the shell (kB, -f) | unlimited | unlimited |
With $env.config.table.header_on_separator set to false, the output is fine:
#
description
soft
hard
0
Maximum size of files created by the shell (kB, -f)
Paste the output into any github field supporting markdown (issue body, comments, etc).
Click Preview
The table looks messed up:
|-#-|---------------------description---------------------|---soft----|---hard----|
| 0 | Maximum size of files created by the shell (kB, -f) | unlimited | unlimited |
Expected behavior
Nushell produces an output that renders as a table on github:
#
description
soft
hard
0
Maximum size of files created by the shell (kB, -f)
unlimited
unlimited
| # | description | soft | hard |
|---|-----------------------------------------------------|-----------|-----------|
| 0 | Maximum size of files created by the shell (kB, -f) | unlimited | unlimited |
default, sqlite, static-link-openssl, system-clipboard, trash, which
installed_plugins
inc, query
Additional context
markdown, and probably restructured table themes should ignore $env.config.table.header_on_separator and produce a valid output regardless of the value it has.
Well I'd argue it's sort of expected, when you use header_on_separator.
To be always compatible with github we shall turn off header_on_separator in case of markdown theme use.
At least that's what I believe in.
I mean these two aren't compatible in a sense of real markdown usage.
Activity
fdncred commentedon Jun 15, 2024
I think this would take some hackery to fix because IIRC "markdown" is just an option on the tabled crate.
weirdan commentedon Jun 15, 2024
And
header_on_separator?zhiburt commentedon Jul 12, 2024
Just bumped into the issue accidentally;
Well I'd argue it's sort of expected, when you use
header_on_separator.To be always compatible with
githubwe shall turn offheader_on_separatorin case ofmarkdowntheme use.At least that's what I believe in.
I mean these two aren't compatible in a sense of real markdown usage.
weirdan commentedon Jul 13, 2024
Ideally it would be part of the theme, not its own setting.
fix(table): keep markdown and restructured headers off the separator (#…