Repository navigation
fix(table): keep markdown and restructured headers off the separator - #19066
Merged
fdncred merged 1 commit intoSep 23, 2026
Merged
Conversation
With `$env.config.table.header_on_separator = true`, the markdown and restructured themes drew the header inside the top border, producing invalid markup (`|-#-|-a-|` instead of a header row plus `|---|`). These themes exist to emit valid markup, so ignore `header_on_separator` for them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Thanks |
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.
With
$env.config.table.header_on_separator = true, themarkdownandrestructuredthemes drew the header inside the top border, which produces invalid markup:These two themes exist to emit markup that other tools parse, so as suggested in #13161,
configure_tablenow ignoresheader_on_separatorfor them. Every table goes throughconfigure_table(general and--expand), so this covers both. Other themes are unchanged.After:
wrap_and_truncate_differ_for_every_theme_with_header_on_separator(from #18979) no longer listsmarkdownandrestructured. With the header in its own row, wrapping and truncating give identical output for this data on every theme (e.g.roundedwithheader_on_separator = false), because overflowing columns are replaced with.... The two only differ in the header-on-border layout, which these themes no longer use.User-facing changes (Release notes)
table --theme markdownandtable --theme restructured(and the matching$env.config.table.modevalues) now always produce valid Markdown / reStructuredText, even when$env.config.table.header_on_separatoris enabled.Tests + Formatting
table_markup_themes_ignore_header_on_separator. It fails without this change (|-#-|-a-|-b-|) and passes with it.cargo test -p nu-command --test tests -- commands::table::: 492 passedcargo fmt --all -- --checkcargo clippy -p nu-table -p nu-command --all-targets -- -D warnings -D clippy::unwrap_usedAdditional notes
Fixes #13161