* fix(#3001): indent continuation lines in serializeChangelog serializeChangelog interpolated bullet bodies verbatim into a single - ${body} (#${pr}) line. Any embedded newline became a column-0 line; parseChangelog's continuation-fold (/^\s+/) didn't pick it up, so flushBullet terminated the bullet early — dropping the continuation text and the (#NNNN) PR trailer (recorded as pr: null). The round-trip property serialize(IR) → parse(text) === IR was false for any body containing \n. Fix: indent continuation lines (body.replace(/\n/g, '\n ')) so the parser folds them correctly. Round-trip test asserts both paragraphs' content AND the PR number survive. * chore(#3001): backfill changeset PR number 3101 --------- Co-authored-by: sim <sim@local>
This commit is contained in:
@@ -26,7 +26,11 @@ function serializeChangelog(ir) {
|
||||
lines.push(`### ${section.type}`);
|
||||
lines.push('');
|
||||
for (const b of section.bullets) {
|
||||
lines.push(`- ${b.body} (#${b.pr})`);
|
||||
// #3001: indent continuation lines so parseChangelog's continuation-fold
|
||||
// (/^\s+/) picks them up instead of terminating the bullet at the first
|
||||
// blank line. A multi-paragraph body round-trips with content preserved.
|
||||
const body = b.body.replace(/\n/g, '\n ');
|
||||
lines.push(`- ${body} (#${b.pr})`);
|
||||
}
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user