Skip to content

fix: add missing Go and JavaScript syntax highlighting in admin CodeMirror#142

Open
NYCU-Chung wants to merge 1 commit into
QingdaoU:masterfrom
NYCU-Chung:fix/admin-codemirror-go-js-syntax
Open

fix: add missing Go and JavaScript syntax highlighting in admin CodeMirror#142
NYCU-Chung wants to merge 1 commit into
QingdaoU:masterfrom
NYCU-Chung:fix/admin-codemirror-go-js-syntax

Conversation

@NYCU-Chung

Copy link
Copy Markdown

Problem

The admin panel's CodeMirror editor only imports C/C++ (clike) and Python syntax modes. Go and JavaScript code renders as plain text without any syntax highlighting.

The OJ frontend's CodeMirror (src/pages/oj/components/CodeMirror.vue) already imports both go and javascript modes, but the admin version (src/pages/admin/components/CodeMirror.vue) is missing them.

Fixes #77

Fix

Add the two missing imports to the admin CodeMirror component:

import 'codemirror/mode/go/go.js'
import 'codemirror/mode/javascript/javascript.js'

…irror

The OJ frontend CodeMirror imports Go and JavaScript modes, but the
admin CodeMirror only imports C/C++ and Python. This causes Go and
JavaScript code to render without syntax highlighting in the admin
panel (e.g. when editing problem templates or viewing submissions).

Fixes QingdaoU#77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Golang syntax is not imported CodeMirror.vue component

1 participant