mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-19 06:38:55 +08:00
decode HTML entity
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const art = require('art-template');
|
const art = require('art-template');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const config = require('../config');
|
const config = require('../config');
|
||||||
|
const he = require('he');
|
||||||
const typeRegrx = /\.(atom|rss|json)$/;
|
const typeRegrx = /\.(atom|rss|json)$/;
|
||||||
|
|
||||||
module.exports = async (ctx, next) => {
|
module.exports = async (ctx, next) => {
|
||||||
@@ -40,6 +41,14 @@ module.exports = async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ctx.state.data.title && (ctx.state.data.title = he.decode(ctx.state.data.title));
|
||||||
|
ctx.state.data.description && (ctx.state.data.description = he.decode(ctx.state.data.description));
|
||||||
|
ctx.state.data.item &&
|
||||||
|
ctx.state.data.item.forEach((item) => {
|
||||||
|
item.title && (item.title = he.decode(item.title));
|
||||||
|
item.description && (item.description = he.decode(item.description));
|
||||||
|
});
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
lastBuildDate: new Date().toUTCString(),
|
lastBuildDate: new Date().toUTCString(),
|
||||||
updated: new Date().toISOString(),
|
updated: new Date().toISOString(),
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
"form-data": "^2.3.2",
|
"form-data": "^2.3.2",
|
||||||
"git-rev-sync": "1.12.0",
|
"git-rev-sync": "1.12.0",
|
||||||
"googleapis": "33.0.0",
|
"googleapis": "33.0.0",
|
||||||
|
"he": "^1.1.1",
|
||||||
"iconv-lite": "0.4.24",
|
"iconv-lite": "0.4.24",
|
||||||
"imgur": "^0.2.1",
|
"imgur": "^0.2.1",
|
||||||
"json-bigint": "0.3.0",
|
"json-bigint": "0.3.0",
|
||||||
|
|||||||
@@ -3564,6 +3564,10 @@ he@1.1.x, he@^1.1.0:
|
|||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.npmjs.org/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
resolved "https://registry.npmjs.org/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
||||||
|
|
||||||
|
he@^1.1.1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
||||||
|
|
||||||
hmac-drbg@^1.0.0:
|
hmac-drbg@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
|
resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
|
||||||
|
|||||||
Reference in New Issue
Block a user