Skip to content
Snippets Groups Projects
Commit 425b3cff authored by syuilo's avatar syuilo
Browse files

Use arrow function

parent 4253f9e0
No related branches found
No related tags found
No related merge requests found
......@@ -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, '&lt;');
};
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;
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment