mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: collapse newlines in user messages to prevent markdown list breaks in session-end
User messages containing newline characters were being added as-is to markdown list items in buildSummarySection(), breaking the list format. Now newlines are replaced with spaces before backtick escaping.
This commit is contained in:
parent
dc11fc2fd8
commit
b678c2f1b0
2 changed files with 45 additions and 2 deletions
|
|
@ -206,10 +206,10 @@ ${summarySection}
|
|||
function buildSummarySection(summary) {
|
||||
let section = '## Session Summary\n\n';
|
||||
|
||||
// Tasks (from user messages — escape backticks to prevent markdown breaks)
|
||||
// Tasks (from user messages — collapse newlines and escape backticks to prevent markdown breaks)
|
||||
section += '### Tasks\n';
|
||||
for (const msg of summary.userMessages) {
|
||||
section += `- ${msg.replace(/`/g, '\\`')}\n`;
|
||||
section += `- ${msg.replace(/\n/g, ' ').replace(/`/g, '\\`')}\n`;
|
||||
}
|
||||
section += '\n';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue