From 67ea1498ff128e6121e9897aa7093107ccfacab6 Mon Sep 17 00:00:00 2001 From: otofune Date: Tue, 28 Feb 2017 20:33:27 +0000 Subject: [common] text & [web] common > scripts > text compiler: support emoji --- src/web/app/common/scripts/text-compiler.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/web/app/common') 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 '
' + token.html + '
'; case 'inline-code': return '' + token.html + ''; + case 'emoji': + return emojinize.encode(token.content) } }).join(''); -- cgit v1.2.3-freya