We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00ba2ed commit 991c5c3Copy full SHA for 991c5c3
1 file changed
server/utils/rss.ts
@@ -55,10 +55,11 @@ export async function generateRssFeed(
55
// 如果有content,则取content第一行作为title,否则用原有逻辑
56
let title: string;
57
if (note.title) {
58
- title = note.title;
+ title = note.title.length > 12 ? note.title.slice(0, 12) + '…' : note.title;
59
} else if (content.trim().length > 0) {
60
// 按换行符分割,取第一行作为title
61
- title = content.split(/\r?\n/)[0].trim();
+ const firstLine = content.split(/\r?\n/)[0].trim();
62
+ title = firstLine.length > 12 ? firstLine.slice(0, 12) + '…' : firstLine;
63
} else {
64
title = 'Note';
65
}
0 commit comments