mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 21:33:08 +02:00
[web::text-compiler] enable compiling emoji with pictograph module (#510)
This commit is contained in:
parent
b8e2bd97db
commit
eb8076cfbf
2 changed files with 3 additions and 3 deletions
|
@ -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",
|
||||
|
|
|
@ -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('');
|
||||
|
||||
|
|
Loading…
Reference in a new issue