summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorotofune <otofune@gmail.com>2017-02-28 20:33:27 +0000
committerotofune <otofune@gmail.com>2017-03-01 03:19:24 +0000
commit67ea1498ff128e6121e9897aa7093107ccfacab6 (patch)
tree66a639bf3a266a68cdd54f67255a270cd7dbc6de /src/web
parentFix type (diff)
downloadsharkey-67ea1498ff128e6121e9897aa7093107ccfacab6.tar.gz
sharkey-67ea1498ff128e6121e9897aa7093107ccfacab6.tar.bz2
sharkey-67ea1498ff128e6121e9897aa7093107ccfacab6.zip
[common] text & [web] common > scripts > text compiler: support emoji
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/scripts/text-compiler.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js
index c9eb73e870..a3c1fe8dde 100644
--- a/src/web/app/common/scripts/text-compiler.js
+++ b/src/web/app/common/scripts/text-compiler.js
@@ -1,5 +1,6 @@
const riot = require('riot');
const nyaize = require('nyaize').default;
+const emojinize = require('emojinize');
const CONFIG = require('./config');
const escape = function(text) {
@@ -35,6 +36,8 @@ module.exports = function(tokens, shouldBreak, shouldEscape) {
return '<pre><code>' + token.html + '</code></pre>';
case 'inline-code':
return '<code>' + token.html + '</code>';
+ case 'emoji':
+ return emojinize.encode(token.content)
}
}).join('');