fix(route): jin10 vip title (#11817)

This commit is contained in:
Tony
2023-02-09 20:50:22 +08:00
committed by GitHub
parent 49c369b42e
commit fc015b9243
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -27,14 +27,14 @@ module.exports = async (ctx) => {
);
const item = data.map((item) => {
const titleMatch = item.data.content.match(/【(.*?)】/);
const titleMatch = item.data.content.match(/^【(.*?)】/);
let title;
let content = item.data.content;
if (titleMatch) {
title = titleMatch[1];
content = content.replace(titleMatch[0], '');
} else {
title = item.data.content;
title = item.data.vip_title || item.data.content;
}
return {
@@ -44,6 +44,7 @@ module.exports = async (ctx) => {
pic: item.data.pic,
}),
pubDate: timezone(parseDate(item.time), 8),
link: item.data.link,
guid: `jin10:index:${item.id}`,
important: item.important,
};
+1 -1
View File
@@ -1,2 +1,2 @@
{{@ content }}
{{ if content }}{{@ content }}{{ /if }}
{{ if pic }}<br><img src="{{ pic }}">{{ /if }}