Fix breadcrumb entity unescaping for angle-bracket thought values#4121
Fix breadcrumb entity unescaping for angle-bracket thought values#4121Copilot wants to merge 7 commits into
Conversation
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/afd3e968-1cce-4ed4-9b34-5202277c707c Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/afd3e968-1cce-4ed4-9b34-5202277c707c Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/afd3e968-1cce-4ed4-9b34-5202277c707c Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
raineorshine
left a comment
There was a problem hiding this comment.
No, the problem has been identified and this is the wrong solution.
Typed angled brackets are already escaped as `"1 < 2" in the thought value. There's no such thing as pseudo tags. That's what HTML character entities are for.
For some reason the ContextBreadcrumbs (or related component) is unescaping the thought value.
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/9309c46c-ea2a-4505-899b-98746ec05ee8 Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/9309c46c-ea2a-4505-899b-98746ec05ee8 Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
Updated in 33318eb. I removed breadcrumb entity unescaping in the rendering path (Link/ContextBreadcrumbs-related flow) and reverted the pseudo-tag |
Agent-Logs-Url: https://github.com/cybersemics/em/sessions/9309c46c-ea2a-4505-899b-98746ec05ee8 Co-authored-by: raineorshine <750276+raineorshine@users.noreply.github.com>
There was a problem hiding this comment.
@copilot Not quite. Something else must be converting <one two> into <one two=""></one> in the ContextBreadcrumbs.
| expect(contextBreadcrumbs.textContent).toBe('test') | ||
| }) | ||
|
|
||
| it('does not unescape encoded thought values in ContextBreadcrumbs', async () => { |
There was a problem hiding this comment.
❌ TDD concern: changed tests PASS on the base branch.
This may indicate the tests do not cover new functionality introduced by this PR.
There was a problem hiding this comment.
Do not modify strip or stripTags in the solution.
Footer breadcrumbs were unescaping encoded thought values (e.g.
<...>) and rendering them as raw tag-like text. This PR fixes the actual root cause by removing entity unescaping from breadcrumb rendering.Root-cause fix
src/components/ContextBreadcrumbs.tsxsrc/components/Link.tsx<...>text.Reverted incorrect approach
src/util/stripTags.tsbehavior to standard tag stripping only.Regression coverage
src/components/__tests__/NavBar.tswith a focused test to ensure encoded values remain encoded in breadcrumb rendering.ContextBreadcrumbstag-stripping test remains passing.Screenshot reference (repro context)