mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
Refactor: Better argument name
This commit is contained in:
parent
589acddcc1
commit
9d89e61785
1 changed files with 5 additions and 5 deletions
|
@ -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>';
|
||||
|
|
Loading…
Reference in a new issue