X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/7c597a05f69c3c4637d213405e55e922844b46a8..refs/heads/ldap_host_failover:/resources/js/code.mjs diff --git a/resources/js/code.mjs b/resources/js/code.mjs index 0b8190379..5881e2512 100644 --- a/resources/js/code.mjs +++ b/resources/js/code.mjs @@ -15,6 +15,7 @@ import 'codemirror/mode/lua/lua'; 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'; @@ -39,6 +40,7 @@ import 'codemirror/addon/scroll/scrollpastend'; // 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', @@ -50,28 +52,32 @@ const modeMap = { 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) => { @@ -86,8 +92,9 @@ const modeMap = { shell: 'shell', sh: 'shell', stext: 'text/x-stex', - bash: 'shell', toml: 'toml', + ts: 'text/typescript', + typescript: 'text/typescript', sql: 'text/x-sql', vbs: 'vbscript', vbscript: 'vbscript',