From eb8076cfbf25503c35085bb8bfcefa8bee0a5d98 Mon Sep 17 00:00:00 2001 From: otofune Date: Wed, 31 May 2017 16:19:30 +0900 Subject: [PATCH] [web::text-compiler] enable compiling emoji with pictograph module (#510) --- package.json | 1 + src/web/app/common/scripts/text-compiler.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1c19528e0..5de37f801 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "multer": "1.3.0", "nprogress": "0.2.0", "page": "1.7.1", + "pictograph": "2.0.0", "prominence": "0.2.0", "pug": "2.0.0-rc.1", "ratelimiter": "3.0.3", diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index 1743a549a..0a9b8022d 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -1,5 +1,5 @@ import * as riot from 'riot'; -//const emojinize = require('emojinize'); +const pictograph = require('pictograph'); import CONFIG from './config'; const escape = text => @@ -34,8 +34,7 @@ export default (tokens, shouldBreak) => { case 'inline-code': return `${token.html}`; case 'emoji': - return `${token.content}`; - //return emojinize.encode(token.content) + return pictograph.dic[token.emoji] || token.content; } }).join('');