(records: DigestRecord[])
| 468 | if (record.day !== currentDay) { |
| 469 | if (lines.length > 0) lines.push(""); |
| 470 | currentDay = record.day; |
| 471 | lines.push(`📅 <b>${htmlEscape(record.day)}</b>`); |
| 472 | } |
| 473 | lines.push(formatDigestLine(record)); |
| 474 | } |
| 475 | |
| 476 | return lines; |
| 477 | } |
| 478 | |
| 479 | function splitDigest(header: string, lines: string[]): string[] { |
| 480 | const continuationHeader = "📦 <b>Biko 消息整理</b>(续)\n\n"; |
| 481 | const parts: string[] = []; |
| 482 | let current = header; |
| 483 | |
| 484 | for (const line of lines) { |
| 485 | const separator = current.endsWith("\n\n") ? "" : "\n"; |
| 486 | if ((current + separator + line).length > MAX_CHUNK_LENGTH) { |
| 487 | parts.push(current); |
no test coverage detected