diff options
| author | syuilo⭐️ <Syuilotan@yahoo.co.jp> | 2016-12-31 18:41:52 +0900 |
|---|---|---|
| committer | syuilo⭐️ <Syuilotan@yahoo.co.jp> | 2016-12-31 18:41:52 +0900 |
| commit | 94e983a5ccd7924325e15149d00a65091730c4f0 (patch) | |
| tree | 9b39a53f466352fbac2c554b16f2dabea449869a | |
| parent | Update README.md (diff) | |
| download | sharkey-94e983a5ccd7924325e15149d00a65091730c4f0.tar.gz sharkey-94e983a5ccd7924325e15149d00a65091730c4f0.tar.bz2 sharkey-94e983a5ccd7924325e15149d00a65091730c4f0.zip | |
Refactor: Better argument name
| -rw-r--r-- | src/web/app/common/scripts/text-compiler.js | 10 |
1 files changed, 5 insertions, 5 deletions
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(/</g, '<') - .replace(/(\r\n|\n|\r)/g, canBreak ? '<br>' : ' '); + .replace(/(\r\n|\n|\r)/g, shouldBreak ? '<br>' : ' '); } else { return token.content - .replace(/(\r\n|\n|\r)/g, canBreak ? '<br>' : ' '); + .replace(/(\r\n|\n|\r)/g, shouldBreak ? '<br>' : ' '); } case 'bold': return '<strong>' + token.bold + '</strong>'; |