Skip to content

Commit 40a9c43

Browse files
fix(details): fix some rare cases where svelte is highlighted as html
1 parent 282d9c6 commit 40a9c43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/[pid=pid]/[org]/[repo]/[id=number]/syntax-highlighting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function detectLanguage(code: string): (SpecialLanguage | (string & {}))
1717
if (match) return match[1];
1818

1919
const hasHTML = /<\/[a-zA-Z0-9-]+>/.test(code);
20-
const hasJS = / (let|var|const|=) /.test(code);
20+
const hasJS = / (let|var|const|=|\/\/) /.test(code);
2121

2222
if (hasHTML && hasJS) return "svelte";
2323
if (hasHTML) return "html";

0 commit comments

Comments
 (0)