1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-02 08:48:37 +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", "multer": "1.3.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"page": "1.7.1", "page": "1.7.1",
"pictograph": "2.0.0",
"prominence": "0.2.0", "prominence": "0.2.0",
"pug": "2.0.0-rc.1", "pug": "2.0.0-rc.1",
"ratelimiter": "3.0.3", "ratelimiter": "3.0.3",

View File

@ -1,5 +1,5 @@
import * as riot from 'riot'; import * as riot from 'riot';
//const emojinize = require('emojinize'); const pictograph = require('pictograph');
import CONFIG from './config'; import CONFIG from './config';
const escape = text => const escape = text =>
@ -34,8 +34,7 @@ export default (tokens, shouldBreak) => {
case 'inline-code': case 'inline-code':
return `<code>${token.html}</code>`; return `<code>${token.html}</code>`;
case 'emoji': case 'emoji':
return `<i>${token.content}</i>`; return pictograph.dic[token.emoji] || token.content;
//return emojinize.encode(token.content)
} }
}).join(''); }).join('');