]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/code.js
Modify Chinese language pack
[bookstack] / resources / js / services / code.js
index 61aac7dc5b4909e9c56a13069fe59287fee2a6d5..f69f28b8e96f7db6498260681925153acc49f6a0 100644 (file)
@@ -16,6 +16,7 @@ import 'codemirror/mode/mllike/mllike';
 import 'codemirror/mode/nginx/nginx';
 import 'codemirror/mode/php/php';
 import 'codemirror/mode/powershell/powershell';
+import 'codemirror/mode/properties/properties';
 import 'codemirror/mode/python/python';
 import 'codemirror/mode/ruby/ruby';
 import 'codemirror/mode/rust/rust';
@@ -28,6 +29,8 @@ import 'codemirror/mode/yaml/yaml';
 // Addons
 import 'codemirror/addon/scroll/scrollpastend';
 
+// Mapping of potential languages or formats from user input
+// to their proper codemirror modes.
 const modeMap = {
     css: 'css',
     c: 'text/x-csrc',
@@ -42,6 +45,7 @@ const modeMap = {
     haskell: 'haskell',
     hs: 'haskell',
     html: 'htmlmixed',
+    ini: 'properties',
     javascript: 'javascript',
     json: {name: 'javascript', json: true},
     js: 'javascript',
@@ -54,6 +58,7 @@ const modeMap = {
     ml: 'mllike',
     nginx: 'nginx',
     powershell: 'powershell',
+    properties: 'properties',
     ocaml: 'mllike',
     php: 'php',
     py: 'python',
@@ -102,7 +107,7 @@ function highlightElem(elem) {
         value: content,
         mode:  mode,
         lineNumbers: true,
-        lineWrapping: true,
+        lineWrapping: false,
         theme: getTheme(),
         readOnly: true
     });
@@ -189,7 +194,7 @@ function wysiwygView(elem) {
         value: content,
         mode:  getMode(lang),
         lineNumbers: true,
-        lineWrapping: true,
+        lineWrapping: false,
         theme: getTheme(),
         readOnly: true
     });
@@ -215,7 +220,7 @@ function popupEditor(elem, modeSuggestion) {
         value: content,
         mode:  getMode(modeSuggestion),
         lineNumbers: true,
-        lineWrapping: true,
+        lineWrapping: false,
         theme: getTheme()
     });
 }