Skip to content

Commit

Permalink
Fix command help formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Dec 13, 2024
1 parent 7b46c60 commit 3c1beb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/cli/src/oclif/hooks/renderMarkdownHelp.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
const chalk = require('chalk');
const { marked } = require('marked');
const TerminalRenderer = require('marked-terminal');
const { markedTerminal } = require('marked-terminal');

marked.setOptions({
renderer: new TerminalRenderer({
marked.use(
markedTerminal({
tab: 2,
width: process.stdout.getWindowSize()[0] - 2,
reflowText: true,
codespan: chalk.underline.bold,
}),
});
);

module.exports = (options) => {
const cmdId = options.id === 'help' ? options.argv[0] : options.id;
const cmd = options.config.findCommand(cmdId);
if (cmd) {
if (cmd.description) {
cmd.description = marked(cmd.description).trim();
cmd.description = marked.parse(cmd.description).trim();
}
// TODO: Do the same for flag descriptions?
}
Expand Down

0 comments on commit 3c1beb9

Please sign in to comment.