修复了在主页上的emoji字段不能被正确的替换为emoji表情的问题

This commit is contained in:
Core 2019-04-12 14:06:02 +08:00
parent 679a118687
commit b9b9ed4250

View file

@ -30,6 +30,7 @@ if (options.enable !== false) {
if (!options.inject && data['no-emoji']) { return data }
const $ = cheerio.load(data.content, {decodeEntities: false})
const excerpt = cheerio.load(data.excerpt,{decodeEntities: false})
if (options.inject) {
$('body').append(`<script>
@ -55,9 +56,11 @@ if (options.enable !== false) {
if (!data['no-emoji']) {
replaceColons($('body')[0], $, emojis)
replaceColons(excerpt('body')[0], excerpt, emojis)
}
data.content = $('body').html()
data.excerpt = excerpt('body').html()
return data
})