Add multi-language syntax highlighting to source editor, improve copy button to copy raw file content, and add permission error handling to file API endpoint

This commit is contained in:
2026-03-22 23:52:10 -04:00
parent 6f694148db
commit 1129d1bca5
3 changed files with 76 additions and 9 deletions
+12 -1
View File
@@ -26,6 +26,17 @@
import { searchKeymap, highlightSelectionMatches } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { autocompletion, completionKeymap, closeBrackets, closeBracketsKeymap } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { markdown } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { python } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { javascript } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { html } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { css } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { json } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { xml } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { sql } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { php } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { cpp } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { java } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { rust } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
import { oneDark } from "https://esm.sh/@codemirror/[email protected]?external=@codemirror/state";
const basicSetup = [
@@ -56,7 +67,7 @@
])
];
window.CodeMirror = { EditorView, EditorState, basicSetup, markdown, oneDark, keymap };
window.CodeMirror = { EditorView, EditorState, basicSetup, markdown, python, javascript, html, css, json, xml, sql, php, cpp, java, rust, oneDark, keymap };
</script>
</head>
<body>