feat(議題解析): 換掉一個段落的內容,標題與其餘段落一字不動

整併留言裡的決策時用它。不整份重寫的理由跟 upsertLineInSection 一樣,只是代價更大:
重寫會把別人在其他段落的編輯一起蓋掉,而議題的編輯紀錄沒有人會去比對。

三件事照著同檔既有的規矩做:圍欄裡的假標題不算段落;同名標題出現不只一次時交回 ambiguous
而不賭第一個(蓋掉的是一整段,猜錯的代價比 tickLine 更高);換行沿用 body 原本的那一種,
CRLF 的 body 裡混進 LF 會讓抽取契約交出的 raw 對不上原文,之後就勾不動那幾行。
This commit is contained in:
2026-09-17 09:08:07 +00:00
parent 97e556a72e
commit a8b816c324
3 changed files with 63 additions and 4 deletions
+2 -2
View File
@@ -47,7 +47,7 @@ main(async () => {
}
const login = resolveLogin({ host: flags.host });
await preflight(login, repo);
const { user } = await preflight(login, repo);
const issue = await fetchIssue(login, repo, index);
const sections = parseSections(issue.body);
@@ -66,7 +66,7 @@ main(async () => {
驗收標準: listSection(sections, '驗收標準'),
影響範圍: listSection(sections, '影響範圍'),
未決事項: listSection(sections, '未決事項'),
未處理留言數: await countUnmergedComments(login, repo, index),
未處理留言數: await countUnmergedComments(login, repo, index, user.login),
};
});