summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-01 14:19:59 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-01 14:19:59 +0900
commit425b3cffdc0de1fee1960e96bf1d2f12a597c171 (patch)
tree1d85ed9c0ad251c133d0fd70dce94172546ca6a5 /src/web
parentClean up (diff)
downloadsharkey-425b3cffdc0de1fee1960e96bf1d2f12a597c171.tar.gz
sharkey-425b3cffdc0de1fee1960e96bf1d2f12a597c171.tar.bz2
sharkey-425b3cffdc0de1fee1960e96bf1d2f12a597c171.zip
Use arrow function
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/scripts/text-compiler.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js
index 3ff617484b..3098d2ff8d 100644
--- a/src/web/app/common/scripts/text-compiler.js
+++ b/src/web/app/common/scripts/text-compiler.js
@@ -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, '&gt;')
.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;
-}
+};