We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cfe17c commit 9d7b468Copy full SHA for 9d7b468
src/routes/[pid=pid]/[org]/[repo]/[id=number]/PageRenderer.svelte
@@ -105,6 +105,12 @@
105
106
// Utils
107
function detectLanguage(code: string): (SpecialLanguage | (string & {})) | undefined {
108
+ const match = code
109
+ .split("\n", 1)[0]
110
+ ?.trim()
111
+ ?.match(/^(?:\/\/|#) ?[^ !]+?\.([A-Za-z0-9]{1,10})$/);
112
+ if (match) return match[1];
113
+
114
const hasHTML = /<\/[a-zA-Z0-9-]+>/.test(code);
115
const hasJS = / (let|var|const|=) /.test(code);
116
@@ -759,7 +765,7 @@
759
765
760
766
span:first-child::before {
761
767
position: absolute;
762
- left: 2.75rem;
768
+ left: 2.5rem;
763
769
}
764
770
771
0 commit comments