chore: optimize performance (replace he with entities) (#6497)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const got = require('@/utils/got');
|
||||
const cache = require('./cache');
|
||||
const he = require('he');
|
||||
const entities = require('entities');
|
||||
const queryString = require('query-string');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
@@ -25,7 +25,7 @@ module.exports = async (ctx) => {
|
||||
link: host,
|
||||
item: data.map((item) => ({
|
||||
title: item.subject,
|
||||
description: he.escape(he.escape(item.content)).replace(/\n/g, '<br>'),
|
||||
description: entities.escape(entities.escape(item.content)).replace(/\n/g, '<br>'),
|
||||
pubDate: new Date(item.date).toUTCString(),
|
||||
link: item.web_url,
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user