Skip to content

Commit

Permalink
fix: kubectl help misformats helm help tables
Browse files Browse the repository at this point in the history
and any preformatted-as-markdown tables

Fixes #5080
  • Loading branch information
starpit committed Jul 2, 2020
1 parent 365b819 commit 356e1c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export default class Markdown extends React.PureComponent<Props> {
)
},
listItem: props => <ListItem className={props.className}>{props.children}</ListItem>,
table: props => <StructuredListWrapper className={props.className}>{props.children}</StructuredListWrapper>,
table: props => (
<StructuredListWrapper className={props.className + ' kui--table-like'}>
{props.children}
</StructuredListWrapper>
),
tableHead: props => <StructuredListHead className={props.className}>{props.children}</StructuredListHead>,
tableBody: props => <StructuredListBody className={props.className}>{props.children}</StructuredListBody>,
tableRow: props => (
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugin-kubectl/src/lib/util/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ const renderHelpUnsafe = <O extends KubeOptions>(
.join('\n')}\n`
)
.concat('\n\n')
.replace(/(--\S+)/g, '`$1`')
.replace(/(\s--\S+)/g, '`$1`')
.replace(/^\n*([^\n.]+)(\.?)/, '### About\n#### $1')
.replace(/\n\s*(Find more information at:)\s+([^\n]+)/, '') // [Find more information] will be in links below the menus
.concat(!aliasesSection ? '' : `### Aliases\n${aliasesSection.content}`)
Expand Down

0 comments on commit 356e1c0

Please sign in to comment.