Improve code-editor.js

This commit is contained in:
Raj Siva-Rajah
2025-06-06 01:44:44 +00:00
parent d1d66e88a7
commit b61a61fc48
2 changed files with 9 additions and 14 deletions
File diff suppressed because one or more lines are too long
@@ -18,20 +18,15 @@ export default function codeEditorFormComponent({
state,
getLanguageExtension() {
switch (language) {
case 'css':
return css()
case 'html':
return html()
case 'javascript':
return javascript()
case 'json':
return json()
case 'php':
return php()
default:
return []
const extensions = {
css: css,
html: html,
javascript: javascript,
json: json,
php: php,
}
return extensions[language]?.() || []
},
init: function () {