修复了在主页上的emoji字段不能被正确的替换为emoji表情的问题
This commit is contained in:
parent
679a118687
commit
b9b9ed4250
1 changed files with 3 additions and 0 deletions
3
index.js
3
index.js
|
@ -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
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue