Fix render emojis

This commit is contained in:
qingwei.li 2017-01-25 21:16:53 +08:00
commit 11f77cd434
3 changed files with 17 additions and 6 deletions

View file

@ -157,3 +157,10 @@ export const merge = Object.assign || function (to) {
return to
}
export function emojify (text) {
return text
.replace(/:(\S*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
.replace(/__colon__/g, ':')
}