mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 02:03:09 +02:00
Refactor: Better argument name
This commit is contained in:
parent
174648c954
commit
94e983a5cc
1 changed files with 5 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
const riot = require('riot');
|
const riot = require('riot');
|
||||||
|
|
||||||
module.exports = function(tokens, canBreak, escape) {
|
module.exports = function(tokens, shouldBreak, escape) {
|
||||||
if (canBreak == null) {
|
if (shouldBreak == null) {
|
||||||
canBreak = true;
|
shouldBreak = true;
|
||||||
}
|
}
|
||||||
if (escape == null) {
|
if (escape == null) {
|
||||||
escape = true;
|
escape = true;
|
||||||
|
@ -17,10 +17,10 @@ module.exports = function(tokens, canBreak, escape) {
|
||||||
return token.content
|
return token.content
|
||||||
.replace(/>/g, '>')
|
.replace(/>/g, '>')
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
.replace(/(\r\n|\n|\r)/g, canBreak ? '<br>' : ' ');
|
.replace(/(\r\n|\n|\r)/g, shouldBreak ? '<br>' : ' ');
|
||||||
} else {
|
} else {
|
||||||
return token.content
|
return token.content
|
||||||
.replace(/(\r\n|\n|\r)/g, canBreak ? '<br>' : ' ');
|
.replace(/(\r\n|\n|\r)/g, shouldBreak ? '<br>' : ' ');
|
||||||
}
|
}
|
||||||
case 'bold':
|
case 'bold':
|
||||||
return '<strong>' + token.bold + '</strong>';
|
return '<strong>' + token.bold + '</strong>';
|
||||||
|
|
Loading…
Reference in a new issue