diff --git a/mateclaw-ui/src/views/Memory/components/MemoryBrowser.vue b/mateclaw-ui/src/views/Memory/components/MemoryBrowser.vue index f14cb44a..2b57bcc0 100644 --- a/mateclaw-ui/src/views/Memory/components/MemoryBrowser.vue +++ b/mateclaw-ui/src/views/Memory/components/MemoryBrowser.vue @@ -92,7 +92,10 @@ function parseSections(content: string): MemorySectionData[] { if (match) { const heading = match[1].trim() const rawBody = match[2].trim() - const userEdited = rawBody.includes('` sequence as an HTML-like line comment + // and conflate this string literal with the one in stripMarker below. + const userEdited = rawBody.includes('\x3c!-- user-edited') // Strip the hidden marker from the display body — it is metadata, and // since renderMarkdown escapes HTML it would otherwise show as raw text. result.push({ heading, body: stripMarker(rawBody), userEdited }) @@ -107,7 +110,8 @@ function parseSections(content: string): MemorySectionData[] { // Strip the hidden user-edited marker so it never shows up as raw text in the // editor (and never accumulates when a section is edited repeatedly). function stripMarker(body: string): string { - return body.replace(/^[ \t]*[ \t]*$/gm, '').trim() + // `\x3c` escape — same reason as in parseSections above. + return body.replace(/^[ \t]*\x3c!-- user-edited:.*-->[ \t]*$/gm, '').trim() } /**