Skip to content

fix: keep tag-like text and numeric citations in assistant answers - #566

Merged
caitlon merged 6 commits into
devfrom
fix/assistant-answer-polish
Oct 11, 2026
Merged

caitlon merged 6 commits into
devfrom
fix/assistant-answer-polish

Conversation

@caitlon

@caitlon caitlon commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Problem

Assistant answers lost text that looks like a tag: x<y and y>z rendered as xz, because raw HTML was skipped. A line such as [1]: https://... in an answer became a markdown link definition, so every [1] citation lost its brackets. The local-source hint still called the corpus private.

Change

  • Raw HTML in an answer is shown as text. The element allowlist and unwrapDisallowed stay, and rehype-raw is still absent, so no HTML element can be created from an answer.
  • A numeric definition line ([n]: ..., also behind list or quote markers) has its opening bracket escaped before parsing, so it stays plain text and the citations keep working. Top-level code blocks and non-numeric definitions are untouched.
  • New local-source hint in en and cs; the JSDoc of AssistantMarkdown describes how [n] actually renders.
  • react-markdown listed in the frontend tech stack.

Verification

  • npm run lint, npm run typecheck, npm run test:coverage (thresholds held).
  • New tests for tag-like text and for definition lines in five layouts; each failed before the change. Raw <script>/<img onerror> in an answer is shown as text and never becomes an element; the test fails if skipHtml comes back.
  • Definition lines inside top-level fenced or indented code are left verbatim.

Migrations

None.

Screenshots

None, text-only change.

@caitlon caitlon added this to the v1.1-polish milestone Oct 11, 2026
@caitlon caitlon added type:bug Something is broken area:frontend React frontend labels Oct 11, 2026
@caitlon caitlon self-assigned this Oct 11, 2026
@greptile-apps

greptile-apps Bot commented Oct 11, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository.

@github-actions github-actions Bot added the size:S Under 300 changed lines. label Oct 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

@caitlon
caitlon merged commit dd8db8f into dev Oct 11, 2026
20 checks passed
@caitlon
caitlon deleted the fix/assistant-answer-polish branch October 11, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend React frontend size:S Under 300 changed lines. type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant