[PR #6932] [MERGED] fix(cli): preserve literal HTML text in Markdown tables #7456

Closed
opened 2026-11-01 21:47:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6932
Author: @ShuaixinHuang
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @morluto

Base: main ← Head: codex/fix-markdown-literal-html


📝 Commits (4)

  • ba181b7 fix(cli): preserve literal HTML text in Markdown tables
  • 908cdb8 merge: synchronize upstream plist CI repair
  • 63f8023 chore: sync upstream plist validation and lifecycle fixes
  • b2d869a chore: sync upstream native and launcher test contracts

📊 Changes

4 files changed (+25 additions, -4 deletions)

View changed files

📝 src/cli/cliOutputFormatter.ts (+3 -0)
📝 tests/acceptance/applications/mobileDirectoryComponents.test.ts (+5 -3)
📝 tests/boundary/cli/cliOutput.test.ts (+8 -0)
📝 tests/boundary/cli/evidenceBundleCommands.test.ts (+9 -1)

📄 Description

Summary

Preserve literal HTML and entity text in Markdown table headers and cells. A retained type such as List<string> currently renders with its generic argument interpreted as an HTML tag, and the literal string &copy; renders as a copyright character.

Problem and expected behavior

Formatting retained facts must preserve their text. Escape &, < and > before adding the formatter's own <br> for actual line breaks. Literal <br> remains text while real CR/LF still displays as a line break. This is a newly reproduced finding; no existing issue is linked.

Change and scope

Add three replacements at the existing table-cell owner, used for both headers and values. Keep the existing pipe/backslash escaping and JSON representation. This concerns HTML/entity text in tables, not every Markdown inline syntax.

Synchronization note: the normal pre-commit hook also simplifies one equivalent encrypted-ZIP fixture options expression in tests/acceptance/applications/mobileDirectoryComponents.test.ts; it does not add a product behavior change.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/cli/cliOutputFormatter.ts, table-cell escaping before column sizing and rendering.
  • Contribution scope fit and linked maintainer decision: ordinary output correctness fix; separate scope decision not applicable.
  • CLI and MCP/tool-catalog contract: Markdown table text changes; JSON output and input schemas unchanged. No MCP registration change.
  • Provider, bridge, target-format, or platform compatibility: no provider or target-format change.
  • Evidence, artifact, provenance, or reconstruction contract: retained Evidence and digests unchanged; Markdown displays the original text.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): no new target interaction or lifecycle ownership.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: standalone Markdown headers/cells with literal HTML/entities and actual CRLF; existing public inspect-evidence-bundle Markdown/JSON case with List<string> and &copy; <br>.
  • Base reproduction or other evidence: new standalone regression fails on base cc18e9ad (1 failed). VitePress rendering of the original table changed &copy; to © and treated <string>/<br> as HTML. After correction, independent VitePress plus parse5 text extraction retains List<T> and &copy; <br> with an actual newline preserved.
  • User-visible CLI/MCP output (if applicable): Markdown contains List&lt;string&gt; and &amp;copy; &lt;br&gt;; JSON retains the unescaped original strings. CommonMark entity rules explain why unescaped text changes on rendering.
  • Remaining proof gaps: synthetic retained-Evidence fixture, local compiled CLI and installed VitePress renderer; no target application or native provider run. No performance claim.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Synchronized with upstream b5c42dfc, including #6945, for six shared CI failures: two stale bound-target error expectations and four launcher/package fixture cases. The two source cases reproduce before synchronization (2 failed, 3 passed). After synchronization, all six previously failing cases pass; bound-target permissions and exact corrupted-catalog/CRLF/bytecode rejection assertions remain. Extended validation on the synchronized ZIP tree ran the complete metadata, MCP, TAR, plist and ZIP files: 231 passed, 22 existing platform skips, and one Windows-local catalog-recording timeout. An unchanged isolated rerun passed in 24 seconds; the original timeout remains recorded and does not establish whole-suite success. Real macOS plist CLI tests were skipped on Windows. The six plist boundary files still pass (64 passed, 3 existing platform skips). On this PR tree, 102 CLI/output tests passed; npm run check and npm run docs:check passed. Full new-head Linux CI must qualify the synchronized change.

Windows x64, pinned Node 24.22.1, locked dependencies; original fix baseline cc18e9ad, synchronized upstream b5c42dfc, head b2d869af98.

  • npm run test:focused -- tests/boundary/cli/cliOutput.test.ts tests/boundary/cli/evidenceBundleCommands.test.ts tests/boundary/cli/filteredArrayOutput.test.ts tests/boundary/cli/markdownNestedFacts.test.ts — all 102 tests passed.
  • Independent VitePress rendering plus parse5 text extraction — literal table header and cell text matched the source, including literal <br> versus actual CRLF.
  • npm run check — all six tasks, module boundaries and architecture guards passed.
  • git diff --check, formatting and normal commit/push hooks — passed.
  • Local checks do not establish complete Linux CI success; consult the current-head Checks tab.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; consumers rendering Markdown see literal source text instead of HTML/entities interpreted as formatting.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows local CLI and renderer only; no live provider or browser session.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no credential handling, process authority, network or containment change.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6932 **Author:** [@ShuaixinHuang](https://github.com/ShuaixinHuang) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/fix-markdown-literal-html` --- ### 📝 Commits (4) - [`ba181b7`](https://github.com/morluto/rea/commit/ba181b79ac45b1c5d6ba72ba913ac203745d05c2) fix(cli): preserve literal HTML text in Markdown tables - [`908cdb8`](https://github.com/morluto/rea/commit/908cdb8d4915326d41d1540340e0332f5cac589f) merge: synchronize upstream plist CI repair - [`63f8023`](https://github.com/morluto/rea/commit/63f8023727a5a3546e3dc8523a268dd564a41cff) chore: sync upstream plist validation and lifecycle fixes - [`b2d869a`](https://github.com/morluto/rea/commit/b2d869af982c5489fa9cf427dcaad1c386b48b55) chore: sync upstream native and launcher test contracts ### 📊 Changes **4 files changed** (+25 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/cliOutputFormatter.ts` (+3 -0) 📝 `tests/acceptance/applications/mobileDirectoryComponents.test.ts` (+5 -3) 📝 `tests/boundary/cli/cliOutput.test.ts` (+8 -0) 📝 `tests/boundary/cli/evidenceBundleCommands.test.ts` (+9 -1) </details> ### 📄 Description ## Summary Preserve literal HTML and entity text in Markdown table headers and cells. A retained type such as `List<string>` currently renders with its generic argument interpreted as an HTML tag, and the literal string `&copy;` renders as a copyright character. ## Problem and expected behavior Formatting retained facts must preserve their text. Escape `&`, `<` and `>` before adding the formatter's own `<br>` for actual line breaks. Literal `<br>` remains text while real CR/LF still displays as a line break. This is a newly reproduced finding; no existing issue is linked. ## Change and scope Add three replacements at the existing table-cell owner, used for both headers and values. Keep the existing pipe/backslash escaping and JSON representation. This concerns HTML/entity text in tables, not every Markdown inline syntax. Synchronization note: the normal pre-commit hook also simplifies one equivalent encrypted-ZIP fixture options expression in `tests/acceptance/applications/mobileDirectoryComponents.test.ts`; it does not add a product behavior change. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/cli/cliOutputFormatter.ts`, table-cell escaping before column sizing and rendering. - Contribution scope fit and linked maintainer decision: ordinary output correctness fix; separate scope decision not applicable. - CLI and MCP/tool-catalog contract: Markdown table text changes; JSON output and input schemas unchanged. No MCP registration change. - Provider, bridge, target-format, or platform compatibility: no provider or target-format change. - Evidence, artifact, provenance, or reconstruction contract: retained Evidence and digests unchanged; Markdown displays the original text. - Target selection, authority, upstream behavior, and cleanup details (if applicable): no new target interaction or lifecycle ownership. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: standalone Markdown headers/cells with literal HTML/entities and actual CRLF; existing public `inspect-evidence-bundle` Markdown/JSON case with `List<string>` and `&copy; <br>`. - Base reproduction or other evidence: new standalone regression fails on base `cc18e9ad` (1 failed). VitePress rendering of the original table changed `&copy;` to `©` and treated `<string>`/`<br>` as HTML. After correction, independent VitePress plus parse5 text extraction retains `List<T>` and `&copy; <br>` with an actual newline preserved. - User-visible CLI/MCP output (if applicable): Markdown contains `List&lt;string&gt;` and `&amp;copy; &lt;br&gt;`; JSON retains the unescaped original strings. [CommonMark entity rules](https://spec.commonmark.org/0.31.2/#entity-and-numeric-character-references) explain why unescaped text changes on rendering. - Remaining proof gaps: synthetic retained-Evidence fixture, local compiled CLI and installed VitePress renderer; no target application or native provider run. No performance claim. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Synchronized with upstream `b5c42dfc`, including #6945, for six shared CI failures: two stale bound-target error expectations and four launcher/package fixture cases. The two source cases reproduce before synchronization (2 failed, 3 passed). After synchronization, all six previously failing cases pass; bound-target permissions and exact corrupted-catalog/CRLF/bytecode rejection assertions remain. Extended validation on the synchronized ZIP tree ran the complete metadata, MCP, TAR, plist and ZIP files: 231 passed, 22 existing platform skips, and one Windows-local catalog-recording timeout. An unchanged isolated rerun passed in 24 seconds; the original timeout remains recorded and does not establish whole-suite success. Real macOS plist CLI tests were skipped on Windows. The six plist boundary files still pass (64 passed, 3 existing platform skips). On this PR tree, 102 CLI/output tests passed; `npm run check` and `npm run docs:check` passed. Full new-head Linux CI must qualify the synchronized change. Windows x64, pinned Node 24.22.1, locked dependencies; original fix baseline `cc18e9ad`, synchronized upstream `b5c42dfc`, head b2d869af982c5489fa9cf427dcaad1c386b48b55. - `npm run test:focused -- tests/boundary/cli/cliOutput.test.ts tests/boundary/cli/evidenceBundleCommands.test.ts tests/boundary/cli/filteredArrayOutput.test.ts tests/boundary/cli/markdownNestedFacts.test.ts` — all 102 tests passed. - Independent VitePress rendering plus parse5 text extraction — literal table header and cell text matched the source, including literal `<br>` versus actual CRLF. - `npm run check` — all six tasks, module boundaries and architecture guards passed. - `git diff --check`, formatting and normal commit/push hooks — passed. - Local checks do not establish complete Linux CI success; consult the current-head Checks tab. ## Compatibility, safety, and release - Breaking changes or migration steps: none; consumers rendering Markdown see literal source text instead of HTML/entities interpreted as formatting. - Real Hopper/Ghidra, browser, or OS coverage: Windows local CLI and renderer only; no live provider or browser session. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no credential handling, process authority, network or containment change. ## Author readiness Human owner: @ShuaixinHuang - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7456
No description provided.