]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/code.js
Merge branch 'master' of git://github.com/albergoniSivaf/BookStack into albergoniSiva...
[bookstack] / resources / js / services / code.js
index 533940e3b695ffc93dc8d5bd4e189bc92d3c5344..8e517dde45abcd794537a6c87ac56092af6fd9d2 100644 (file)
@@ -25,6 +25,7 @@ import 'codemirror/mode/sql/sql';
 import 'codemirror/mode/toml/toml';
 import 'codemirror/mode/xml/xml';
 import 'codemirror/mode/yaml/yaml';
+import 'codemirror/mode/pascal/pascal'
 
 // Addons
 import 'codemirror/addon/scroll/scrollpastend';
@@ -78,6 +79,7 @@ const modeMap = {
     xml: 'xml',
     yaml: 'yaml',
     yml: 'yaml',
+    pascal: 'text/x-pascal',
 };
 
 /**
@@ -97,7 +99,7 @@ function highlight() {
 function highlightElem(elem) {
     const innerCodeElem = elem.querySelector('code[class^=language-]');
     elem.innerHTML = elem.innerHTML.replace(/<br\s*[\/]?>/gi ,'\n');
-    const content = elem.textContent.trim();
+    const content = elem.textContent;
 
     let mode = '';
     if (innerCodeElem !== null) {