summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorotofune <otofune@users.noreply.github.com>2017-05-31 16:19:30 +0900
committerGitHub <noreply@github.com>2017-05-31 16:19:30 +0900
commiteb8076cfbf25503c35085bb8bfcefa8bee0a5d98 (patch)
tree8306368f326084dd63edcdef815e77eb0f61042e
parent:sparkles: (diff)
downloadsharkey-eb8076cfbf25503c35085bb8bfcefa8bee0a5d98.tar.gz
sharkey-eb8076cfbf25503c35085bb8bfcefa8bee0a5d98.tar.bz2
sharkey-eb8076cfbf25503c35085bb8bfcefa8bee0a5d98.zip
[web::text-compiler] enable compiling emoji with pictograph module (#510)
-rw-r--r--package.json1
-rw-r--r--src/web/app/common/scripts/text-compiler.js5
2 files changed, 3 insertions, 3 deletions
diff --git a/package.json b/package.json
index 1c19528e09..5de37f8012 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 1743a549aa..0a9b8022df 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 `<code>${token.html}</code>`;
case 'emoji':
- return `<i>${token.content}</i>`;
- //return emojinize.encode(token.content)
+ return pictograph.dic[token.emoji] || token.content;
}
}).join('');