Skip to content

Commit 6fab387

Browse files
committed
☕ parse code block filetype
1 parent 8c8357c commit 6fab387

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.scripts/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export function createMarkdownFromHelp(body: string): string {
1212
const codeBlockIndent = " ";
1313
let lastIndent = firstlineIndent;
1414
body = body.replaceAll(
15-
/(?<normal>.*?)[\n ]>\n(?<code>.*?)(?:\n(?=<)|$)|(?<rest>.*)/gs,
16-
(_, normal: string, code: string, rest: string) => {
15+
/(?<normal>.*?)[\n ]>(?<ft>\w*)\n(?<code>.*?)(?:\n(?=<)|$)|(?<rest>.*)/gs,
16+
(_, normal: string, _ft: string, code: string, rest: string) => {
1717
if (rest !== undefined) {
1818
return formatNormalBlock(rest);
1919
}

0 commit comments

Comments
 (0)