fix(dingtalk): only suffix '(cont.)' on continuation chunks, not first (#2977)

This commit is contained in:
chinesepowered 2026-04-17 17:11:46 -07:00 committed by GitHub
parent 418acc548b
commit b6e8f89687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -146,11 +146,12 @@ export class DingtalkChannel extends ChannelBase {
const chunks = normalizeDingTalkMarkdown(text);
const title = extractTitle(text);
for (const chunk of chunks) {
for (let i = 0; i < chunks.length; i++) {
const chunk = chunks[i]!;
const body = {
msgtype: 'markdown',
markdown: {
title: chunks.length > 1 ? `${title} (cont.)` : title,
title: i === 0 ? title : `${title} (cont.)`,
text: chunk,
},
};