mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 21:05:15 +00:00
Use arrow function
This commit is contained in:
parent
4253f9e083
commit
425b3cffdc
1 changed files with 5 additions and 6 deletions
|
@ -3,20 +3,19 @@ const nyaize = require('nyaize').default;
|
|||
const emojinize = require('emojinize');
|
||||
const CONFIG = require('./config');
|
||||
|
||||
const escape = function(text) {
|
||||
return text
|
||||
const escape = text =>
|
||||
text
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<');
|
||||
};
|
||||
|
||||
module.exports = function(tokens, shouldBreak) {
|
||||
module.exports = (tokens, shouldBreak) => {
|
||||
if (shouldBreak == null) {
|
||||
shouldBreak = true;
|
||||
}
|
||||
|
||||
const me = riot.mixin('i').me;
|
||||
|
||||
let text = tokens.map(function(token) {
|
||||
let text = tokens.map(token => {
|
||||
switch (token.type) {
|
||||
case 'text':
|
||||
return escape(token.content)
|
||||
|
@ -45,4 +44,4 @@ module.exports = function(tokens, shouldBreak) {
|
|||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue