@@ -3,6 +3,7 @@ import {htmlEscape} from "./htmlEscape.js";
3
3
import { cliBinName , npxRunPrefix } from "../../src/config.js" ;
4
4
import { buildHtmlTable } from "./buildHtmlTable.js" ;
5
5
import { buildHtmlHeading } from "./buildHtmlHeading.js" ;
6
+ import { htmlEscapeWithCodeMarkdown } from "./htmlEscapeWithCodeMarkdown.js" ;
6
7
7
8
export async function getCommandHtmlDoc ( command : CommandModule < any , any > , {
8
9
cliName = cliBinName ,
@@ -45,7 +46,7 @@ export async function getCommandHtmlDoc(command: CommandModule<any, any>, {
45
46
46
47
return [
47
48
`<a href="${ subCommandsParentPageLink != null ? ( subCommandsParentPageLink + "/" ) : "" } ${ commandPageLink } "><code>` + htmlEscape ( cliName + " " + cliCommand ) + "</code></a>" ,
48
- htmlEscape ( String ( subCommand . describe ?? "" ) )
49
+ htmlEscapeWithCodeMarkdown ( String ( subCommand . describe ?? "" ) )
49
50
] ;
50
51
} )
51
52
. filter ( ( row ) : row is string [ ] => row != null )
@@ -61,7 +62,7 @@ export async function getCommandHtmlDoc(command: CommandModule<any, any>, {
61
62
for ( const group of optionGroups ) {
62
63
let groupName = group . name ;
63
64
if ( groupName !== "default" ) {
64
- res += buildHtmlHeading ( "h3" , htmlEscape ( groupName ) , encodeURIComponent ( groupName . toLowerCase ( ) ) ) ;
65
+ res += buildHtmlHeading ( "h3" , htmlEscapeWithCodeMarkdown ( groupName ) , encodeURIComponent ( groupName . toLowerCase ( ) ) ) ;
65
66
}
66
67
67
68
res += renderOptionsGroupOptionsTable ( group . options ) + "\n" ;
@@ -207,7 +208,7 @@ function renderOptionsGroupOptionsTable(options: {name: string, option: Options}
207
208
}
208
209
}
209
210
210
- let optionDescription : string [ ] = option . description != null ? [ htmlEscape ( option . description ) ] : [ ] ;
211
+ let optionDescription : string [ ] = option . description != null ? [ htmlEscapeWithCodeMarkdown ( option . description ) ] : [ ] ;
211
212
212
213
const hasDefaultDescription = option . defaultDescription != null && option . defaultDescription . trim ( ) . length > 0 ;
213
214
if ( option . default != null || hasDefaultDescription ) {
@@ -218,7 +219,7 @@ function renderOptionsGroupOptionsTable(options: {name: string, option: Options}
218
219
}
219
220
220
221
if ( option . type != null ) {
221
- optionDescription . push ( `<code><span style="opacity: 0.4">(</span>${ htmlEscape ( option . type ) } <span style="opacity: 0.4">)</span></code>` ) ;
222
+ optionDescription . push ( `<code><span style="opacity: 0.4">(</span>${ htmlEscape ( option . type + ( option . array ? "[]" : "" ) ) } <span style="opacity: 0.4">)</span></code>` ) ;
222
223
}
223
224
224
225
if ( option . demandOption ) {
0 commit comments