Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Preserve bullet markers for nested items in changelog entries
Previously, nested bullets like:
  - Add feature
      - Sub-item 1
      - Sub-item 2

Would render as:
  - Add feature by @user in [#1]
    Sub-item 1
    Sub-item 2

Now correctly renders as:
  - Add feature by @user in [#1]
    - Sub-item 1
    - Sub-item 2

Nested items do NOT get author/PR attribution - only the top-level entry does.
  • Loading branch information
BYK committed Dec 26, 2025
commit 28121acfcceeb1748370178cd7a1fd4e129f4dfe
2 changes: 2 additions & 0 deletions docs/src/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ of the PR title. If no such section is present, the PR title is used as usual.
- Session management
```

Note: Nested items do NOT get author/PR attribution - only the top-level entry does.

3. **Plain Text**: If no bullets are used, the entire content is treated as a
single changelog entry. Multi-line text is automatically joined with spaces
to ensure valid markdown output.
Expand Down
27 changes: 15 additions & 12 deletions src/utils/__tests__/changelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3043,9 +3043,10 @@ Update all dependencies to their latest versions for improved security`,
expect(changes).toContain(
'Add comprehensive user authentication system by @alice in [#1]'
);
expect(changes).toContain(' OAuth2 support');
expect(changes).toContain(' Two-factor authentication');
expect(changes).toContain(' Session management');
// Nested bullets preserve the bullet marker
expect(changes).toContain(' - OAuth2 support');
expect(changes).toContain(' - Two-factor authentication');
expect(changes).toContain(' - Session management');
});

it('should create multiple changelog entries from multiple bullets in PR', async () => {
Expand Down Expand Up @@ -3113,15 +3114,15 @@ Update all dependencies to their latest versions for improved security`,
const result = await generateChangesetFromGit(dummyGit, '1.0.0', 10);
const changes = result.changelog;

// First entry with nested content
// First entry with nested content (bullets preserved)
expect(changes).toContain('Add authentication by @alice in [#1]');
expect(changes).toContain(' OAuth2');
expect(changes).toContain(' 2FA');
expect(changes).toContain(' - OAuth2');
expect(changes).toContain(' - 2FA');

// Second entry with nested content
// Second entry with nested content (bullets preserved)
expect(changes).toContain('Add user profiles by @alice in [#1]');
expect(changes).toContain(' Avatar upload');
expect(changes).toContain(' Bio editing');
expect(changes).toContain(' - Avatar upload');
expect(changes).toContain(' - Bio editing');
});

it('should ignore empty changelog entry sections', async () => {
Expand Down Expand Up @@ -3504,8 +3505,9 @@ Neither should this.`;
expect(result).not.toBeNull();
if (result) {
expect(result[0].text).toBe('Add authentication system');
// Nested bullets preserve the bullet marker
expect(result[0].nestedContent).toBe(
' OAuth2 support\n Two-factor authentication\n Session management'
' - OAuth2 support\n - Two-factor authentication\n - Session management'
);
}
});
Expand All @@ -3526,11 +3528,12 @@ Neither should this.`;
expect(result).not.toBeNull();
if (result) {
expect(result[0].text).toBe('Add authentication system');
// Nested bullets preserve the bullet marker
expect(result[0].nestedContent).toBe(
' OAuth2 support\n Two-factor authentication'
' - OAuth2 support\n - Two-factor authentication'
);
expect(result[1].text).toBe('Add user profile page');
expect(result[1].nestedContent).toBe(' Avatar upload\n Bio editing');
expect(result[1].nestedContent).toBe(' - Avatar upload\n - Bio editing');
expect(result[2].text).toBe('Add settings panel');
expect(result[2].nestedContent).toBeUndefined();
}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ function parseChangelogContent(content: string): ChangelogEntryItem[] {
// Check if this is a nested bullet (more than 3 spaces of indentation, or tab)
const nestedMatch = line.match(/^(\s{4,}|\t+)[-*+]\s+(.+)$/);
if (nestedMatch) {
nestedLines.push(` ${nestedMatch[2].trim()}`);
// Preserve the bullet marker for nested items
nestedLines.push(` - ${nestedMatch[2].trim()}`);
} else if (line.trim()) {
// Non-empty line that's not a bullet - could be continuation text or nested content
// Add to nested content if it has any indentation or follows other nested content
Expand Down
Loading