Taichi Masuyama 3 лет назад
Родитель
Сommit
37ae1b4083
2 измененных файлов с 2 добавлено и 3 удалено
  1. 1 2
      packages/app/src/server/routes/hackmd.js
  2. 1 1
      packages/hackmd/src/index.js

+ 1 - 2
packages/app/src/server/routes/hackmd.js

@@ -73,10 +73,9 @@ module.exports = function(crowi, app) {
    */
   const loadStyles = function(req, res) {
 
-    const stylesCSSLineBreaksRemoved = hackmdFiles.stylesCSS.replace(/(\r\n|\n|\r)/gm, ''); // https://stackoverflow.com/questions/10805125/how-to-remove-all-line-breaks-from-a-string
     // generate definitions to replace
     const definitions = {
-      styles: stylesCSSLineBreaksRemoved,
+      styles: hackmdFiles.stylesCSS,
     };
     // inject styles to script
     const script = ejs.render(hackmdFiles.stylesJS, definitions);

+ 1 - 1
packages/hackmd/src/index.js

@@ -11,5 +11,5 @@ const stylesCSSFile = fs.readFileSync(path.resolve(__dirname, `${dirPath}/styles
 module.exports = {
   stylesJS: stylesJSFile.toString(),
   agentJS: agentJSFile.toString(),
-  stylesCSS: stylesCSSFile.toString(),
+  stylesCSS: stylesCSSFile.toString().replace(/(\r\n|\n|\r)/gm, ''), // https://stackoverflow.com/questions/10805125/how-to-remove-all-line-breaks-from-a-string
 };