diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index e08ef74417..62636939bf 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -1,8 +1,8 @@ const riot = require('riot'); -module.exports = function(tokens, canBreak, escape) { - if (canBreak == null) { - canBreak = true; +module.exports = function(tokens, shouldBreak, escape) { + if (shouldBreak == null) { + shouldBreak = true; } if (escape == null) { escape = true; @@ -17,10 +17,10 @@ module.exports = function(tokens, canBreak, escape) { return token.content .replace(/>/g, '>') .replace(/' : ' '); + .replace(/(\r\n|\n|\r)/g, shouldBreak ? '
' : ' '); } else { return token.content - .replace(/(\r\n|\n|\r)/g, canBreak ? '
' : ' '); + .replace(/(\r\n|\n|\r)/g, shouldBreak ? '
' : ' '); } case 'bold': return '' + token.bold + '';