We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfeed16 commit 9bcf38bCopy full SHA for 9bcf38b
1 file changed
src/utils/prism.ts
@@ -94,7 +94,7 @@ export function normalizeLanguage(
94
95
function mapLanguage(raw: string): CodeLanguage | null {
96
if (!raw) return null;
97
- if (raw === 'ts') return 'typescript';
+ if (raw === 'ts' || raw === 'typescript') return 'typescript';
98
if (raw === 'tsx') return 'tsx';
99
if (raw === 'js' || raw === 'javascript') return 'javascript';
100
if (raw === 'jsx') return 'jsx';
@@ -194,7 +194,7 @@ export function inferLanguageFromCode(code: string): CodeLanguage | null {
194
return 'typescript';
195
}
196
197
- if (c.includes('function ') || c.includes('const ') || c.includes('let ')) {
+ if (c.includes('function ') || c.includes('const ') || c.includes('let ') || c.includes('class ')) {
198
199
200
0 commit comments