fix: Todo-Liste parst nur letzte ID korrekt (\r\n-Problem)
Backend: sb.AppendLine() durch sb.Append()+\n ersetzt für konsistente Zeilenenden auf allen Plattformen. Frontend: \r defensiv entfernen vor Regex-Matching, da JS-Regex (.+)$ kein \r matcht und nur letzte Zeile geparsed wurde.
This commit is contained in:
1 parent
d6d7b6c04f
commit
fa947c82ed
2 files changed
+2
-2
No files matched your search
@@ -562,7 +562,7 @@ public class ToolService
|
||||
var priority = todo.TryGetProperty("priority", out var prio) ? prio.GetString() : null;
|
||||
var icon = status switch { "completed" => "✅", "in_progress" => "🔄", _ => "⬜" };
|
||||
var prioTag = priority != null ? $" [{priority}]" : "";
|
||||
sb.AppendLine($"{icon} [{id}]{prioTag} {content}");
|
||||
sb.Append($"{icon} [{id}]{prioTag} {content}\n");
|
||||
}
|
||||
return sb.Length == 0 ? "(leere Todo-Liste)" : sb.ToString().TrimEnd();
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ function buildTodoList(result, isError) {
|
||||
const container = document.createElement('div');
|
||||
container.className = 'todo-list' + (isError ? ' tool-error' : '');
|
||||
|
||||
const lines = result.split('\n').filter(l => l.trim());
|
||||
const lines = result.split('\n').map(l => l.replace(/\r$/, '')).filter(l => l.trim());
|
||||
for (const line of lines) {
|
||||
// Format: ICON [id] [priority] content
|
||||
const m = line.match(/^(\S+)\s+\[([^\]]+)\]\s+(?:\[([^\]]+)\]\s+)?(.+)$/);
|
||||
|
||||
Reference in new issue
Block a user