fix: keep notification summaries in plain text

- Force notification summaries to avoid markdown formatting
- Normalize generated notification text before system display
- Cover plain-text notification formatting with tests
This commit is contained in:
Bohdan Triapitsyn
2026-04-06 17:40:20 +03:00
parent 9254ec0783
commit f884919165
5 changed files with 40 additions and 4 deletions
@@ -56,4 +56,19 @@ describe('notification message helpers', () => {
expect(result).toBe('short summary');
});
it('normalizes markdown summary to plain text', async () => {
const result = await prepareNotificationLastMessage({
message: '0123456789',
summarize: async () => "**Committed.**\n\n- Commit: `85924b9d`\n- Message: `fix desktop notifications`",
settings: {
summarizeLastMessage: true,
summaryThreshold: 5,
summaryLength: 80,
maxLastMessageLength: 200,
},
});
expect(result).toBe('Committed. Commit: 85924b9d Message: fix desktop notifications');
});
});