From c4bdd8fc4bc95b956088d5d7e114e0ac379fb87b Mon Sep 17 00:00:00 2001 From: RinZ27 <222222878+RinZ27@users.noreply.github.com> Date: Tue, 10 Mar 2026 16:20:20 +0700 Subject: [PATCH] fix(ui): escape array content in cards and fix double-escaping --- packages/ui/src/panel/cards.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/panel/cards.ts b/packages/ui/src/panel/cards.ts index 00f254b..45ae0ca 100644 --- a/packages/ui/src/panel/cards.ts +++ b/packages/ui/src/panel/cards.ts @@ -18,7 +18,7 @@ interface CardOptions { export function createCard({ icon, content, meta, type }: CardOptions): string { const typeClass = type ? styles[type] : '' const contentHtml = Array.isArray(content) - ? `
${content.join('')}
` + ? `
${content.map((line) => `${escapeHtml(line)}`).join('')}
` : `${escapeHtml(content)}` return ` @@ -40,13 +40,13 @@ export function createReflectionLines(reflection: { }): string[] { const lines: string[] = [] if (reflection.evaluation_previous_goal) { - lines.push(`
🔍 ${escapeHtml(reflection.evaluation_previous_goal)}
`) + lines.push(`
🔍 ${reflection.evaluation_previous_goal}
`) } if (reflection.memory) { - lines.push(`
💾 ${escapeHtml(reflection.memory)}
`) + lines.push(`
💾 ${reflection.memory}
`) } if (reflection.next_goal) { - lines.push(`
🎯 ${escapeHtml(reflection.next_goal)}
`) + lines.push(`
🎯 ${reflection.next_goal}
`) } return lines }