1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-12 21:58:58 +09:00

[web::text-compiler] enable compiling emoji with pictograph module (#510)

This commit is contained in:
otofune 2017-05-31 16:19:30 +09:00 committed by GitHub
parent b8e2bd97db
commit eb8076cfbf
2 changed files with 3 additions and 3 deletions

View File

@ -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",

View File

@ -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('');