Skip to content

fix: show named characters in exported session messages - #205362

Merged
vincentkoc merged 2 commits into
mainfrom
fix/export-html-named-character-references-c34
Nov 26, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/export-html-named-character-references-c34

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

In a standalone HTML session export, a message containing © showed that spelling in the conversation card. The same thing happened inside emphasis. Both should display ©.

User Impact

User and assistant messages now display named characters in ordinary Markdown. Inline code and typed URLs keep the original spelling. The embedded transcript retains the original message.

Why This Change Was Made

The export viewer was escaping ordinary text a second time before the browser displayed it. It now delegates ordinary text and nested inline formatting to the bundled Marked renderer. The link renderer uses Marked’s autolink flag to display a typed address literally. Explicit link labels still support inline Markdown, and raw HTML and code retain their existing handling.

Evidence

  • Replayed the same synthetic /export-session transcript before and after the change. Across 22 cards per revision, paragraph and emphasized text displayed © on the fix, and inline code displayed ©. Numeric references, literal HTML, HTTPS link markup and archived message content matched their controls.
  • The minimized case and both exact property replays passed. A larger local property run ended before returning a result.
  • Replayed 42 cards per revision through the standalone viewer. For <https://example.test/&copy;>, the visible link text and destination both retained &copy;. The embedded transcript was byte-identical on the frozen source, the previous draft head, and this repair.
  • DOM regressions cover prose and inline code for both message roles, plus the visible label and destination of automatic and explicitly labeled links. Hosted Vitest passed the named-reference and autolink regressions on the signed head. HTML export tests · Protected CI

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR renders named character references in exported Markdown while preserving literal spelling in code and typed URLs.

Example: Export a message containing © © &copy;.

  • Before: The card displays © © ©.
  • After: The card displays © © ©, preserving emphasis and literal inline code.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation resolves the previous finding, but inspectable behavior proof is absent and the failing CI check remains unattributed.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Standalone HTML exports display named-reference spellings instead of their characters in ordinary message text.
Reason: The maintainer-authored direction repairs normal Markdown behavior through the existing owner without adding options or changing stored data.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current export-rendering bug, resolves the earlier autolink finding, and introduces no further actionable code defects found in this review.

Reviewed head: d300b11874841cc1f951bbb1d003b29d51441d0a

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Attach sanitized before/after screenshots of the actual export showing ordinary and emphasized ©, literal inline code, and the typed autolink, redacting sensitive data; the committed regressions also lack a published base-fail/head-pass result.
Agent review details

How this fits together

The export command embeds transcript data, browser dependencies, and the viewer template into standalone HTML; the browser renders message cards through Marked and the existing custom renderers.

flowchart LR
  A[Session transcript] --> B[Export command]
  B --> C[Standalone HTML]
  C --> D[Marked and custom renderers]
  D --> E[Browser message cards]
Loading

Technical review

Best possible solution:

Keep this focused repair in the existing renderers, using Marked for ordinary text while preserving literal raw-block text, code, and autolinks.

Do we have a high-confidence way to reproduce the issue?

Current-main leaf escaping and the pinned Marked contract establish the © rendering failure; no target code was executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair: it reuses Marked's text rendering, retains the raw-block exception, and now preserves the distinct autolink contract without new machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7d2b9c37cbd3.

Provenance checked

  • Ordinary Markdown text rendering changes intended behavior with a stated reason (759c237: The earlier traversal repair deliberately retained existing leaf escaping and security hooks; it did not introduce the original escaping behavior.)
  • Custom Markdown link renderer keeps the original intent (fd12a48: Restrict clickable link schemes, escape attributes, and retain labels for disallowed destinations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f8524ec adds src/auto-reply/reply/export-html/template.js:1734 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f8524ec77a39; files: src/auto-reply/reply/export-html/template.js)
  • Vincent Koc: Raw commit c72435e adds src/auto-reply/reply/export-html/template.js:956 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c72435e19089; files: src/auto-reply/reply/export-html/template.js)
  • xingzhou: Raw commit c5b9b25 adds src/auto-reply/reply/export-html/template.js:77 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c5b9b254bff4; files: src/auto-reply/reply/export-html/template.js)

PR surface

Source 0, Tests +25. Total +25 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 25 0 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 28 3 +25

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-25T13:24:53.276Z sha be59dfb :: needs changes before merge. :: [P2] Preserve literal character references in autolink labels

Reviewed November 25, 2026, 9:30 AM ET / 14:30 UTC (Revision 2).

@vincentkoc
vincentkoc marked this pull request as ready for review November 25, 2026 14:18
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc vincentkoc self-assigned this Nov 25, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 25, 2026
@vincentkoc
vincentkoc merged commit 2cb81bb into main Nov 26, 2026
249 of 251 checks passed
@vincentkoc
vincentkoc deleted the fix/export-html-named-character-references-c34 branch November 26, 2026 01:14
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 26, 2026
…irement-rule

* origin/main: (172 commits)
  test(gateway): expect a revoked person's Goal retry to be hidden as not found (#205698)
  fix: keep browser disabled when only hardening relay authentication (#203137)
  fix: recover Linux stream automations after command-anchor crashes (#203149)
  fix(whatsapp): identify voice-note captions as text in delivery receipts (#205381)
  fix(test): unblock restart-auth plugin and worker publication qualification (#205679)
  chore(ui): refresh control ui locales (#205691)
  fix: reduce memory during SQLite usage refresh (#201064)
  fix(plugins): readmit native captures with a dangling host link
  chore(i18n): refresh native locales (#205680)
  fix(update): hash SQLite lock bytes as zeros so Windows exclusion cannot fail verification (#205668)
  fix(skill-workshop): skip the skill diet for skills with Markdown outside support directories (#204881)
  fix(plugins): clarify dated SDK migration notices (#200932)
  fix: keep the resident launcher when reinstalling Gateway (#205655)
  fix: show the whole reply when you reopen a TUI session (#200455)
  test(ui): wait for restored speech player authorization (#199502)
  feat: let agents post approved GitHub comments (#204301)
  fix(agents): honor imageMaxDimensionPx at the provider and CLI image handoffs (#205663)
  chore(ui): refresh control ui locales (#205664)
  fix(google): preserve playback when Google Live splits audio into parts (#205364)
  fix: show named characters in exported session messages (#205362)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
)

* fix: show named characters in exported session messages

* fix: preserve typed URL labels in exported chats

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant