Skip to content

Commit f84c549

Browse files
committed
fix: hyphen for matching hyphenated lang names
1 parent 192e0a6 commit f84c549

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/cli/templates/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export async function generateResponse(
149149
export function extractCodeBlock(text: string, language?: string): string | null {
150150
const pattern = language
151151
? new RegExp(`\`\`\`${language}\\n([\\s\\S]*?)\`\`\``)
152-
: /```[\w]*\n([\s\S]*?)```/;
152+
: /```[\w-]*\n([\s\S]*?)```/;
153153
const match = text.match(pattern);
154154
return match ? match[1].trim() : null;
155155
}

0 commit comments

Comments
 (0)