// Modes
import 'codemirror/mode/css/css';
import 'codemirror/mode/clike/clike';
+import 'codemirror/mode/dart/dart';
import 'codemirror/mode/diff/diff';
import 'codemirror/mode/fortran/fortran';
import 'codemirror/mode/go/go';
import 'codemirror/mode/markdown/markdown';
import 'codemirror/mode/mllike/mllike';
import 'codemirror/mode/nginx/nginx';
+import 'codemirror/mode/octave/octave';
import 'codemirror/mode/perl/perl';
import 'codemirror/mode/pascal/pascal';
import 'codemirror/mode/php/php';
import 'codemirror/mode/rust/rust';
import 'codemirror/mode/shell/shell';
import 'codemirror/mode/sql/sql';
+import 'codemirror/mode/stex/stex';
+import 'codemirror/mode/swift/swift';
import 'codemirror/mode/toml/toml';
import 'codemirror/mode/vb/vb';
import 'codemirror/mode/vbscript/vbscript';
// Value can be a mode string or a function that will receive the code content & return the mode string.
// The function option is used in the event the exact mode could be dynamic depending on the code.
const modeMap = {
+ bash: 'shell',
css: 'css',
c: 'text/x-csrc',
java: 'text/x-java',
'c++': 'text/x-c++src',
'c#': 'text/x-csharp',
csharp: 'text/x-csharp',
+ dart: 'application/dart',
diff: 'diff',
for: 'fortran',
fortran: 'fortran',
+ 'f#': 'text/x-fsharp',
+ fsharp: 'text/x-fsharp',
go: 'go',
haskell: 'haskell',
hs: 'haskell',
html: 'htmlmixed',
ini: 'properties',
- javascript: 'javascript',
- json: {name: 'javascript', json: true},
- js: 'javascript',
- jl: 'julia',
- julia: 'julia',
+ javascript: 'text/javascript',
+ json: 'application/json',
+ js: 'text/javascript',
+ jl: 'text/x-julia',
+ julia: 'text/x-julia',
+ latex: 'text/x-stex',
lua: 'lua',
+ matlab: 'text/x-octave',
md: 'markdown',
mdown: 'markdown',
markdown: 'markdown',
ml: 'mllike',
nginx: 'nginx',
+ octave: 'text/x-octave',
perl: 'perl',
pl: 'perl',
powershell: 'powershell',
properties: 'properties',
- ocaml: 'mllike',
+ ocaml: 'text/x-ocaml',
pascal: 'text/x-pascal',
pas: 'text/x-pascal',
php: (content) => {
rs: 'rust',
shell: 'shell',
sh: 'shell',
- bash: 'shell',
- toml: 'toml',
sql: 'text/x-sql',
+ stext: 'text/x-stex',
+ swift: 'text/x-swift',
+ toml: 'toml',
+ ts: 'text/typescript',
+ typescript: 'text/typescript',
vbs: 'vbscript',
vbscript: 'vbscript',
'vb.net': 'text/x-vb',