Render LaTeX equations with KaTeX in Content#2131
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Visual recap — generation failedThe visual recap could not be generated for this pull request. This is informational only and does not block the PR. Diagnostic: No plan URL: create-visual-recap failed 422 Unprocessable Entity: {"error":"Could not parse expression with acorn"} Agent output: Authored recap-source.json for PR #2131. It includes the full file map, editor/error wireframes, rendering-flow diagram, and five key-code review tabs. --- ⠀ 🟢 Visual Recap source is ready for CI’s deterministic publisher. stderr: Reading additional input from stdin... 2026-07-14T21:59:55.281064Z ERROR codex_core::session::session: failed to load skill /home/runner/work/agent-native/agent-native/.agents/skills/agent-native-toolkit/SKILL.md: missing YAML frontmatter delimited by --- |
There was a problem hiding this comment.
Builder reviewed your changes and found 2 potential issues 🟡
Review Details
Incremental Code Review Summary
The latest commit addresses both previously reported issues: MathRenderer now emits KaTeX markup during render for SSR/first paint, and the export parser protects inline math/code spans with collision-resistant placeholders so surrounding emphasis and links remain parseable. I resolved both prior review threads after verifying those changes in the latest diff. KaTeX remains configured with trust: false, accessible HTML+MathML output, bounded expansion, and visible malformed-source fallbacks.
New Findings
- 🟡 MEDIUM — The placeholder scanner still tokenizes escaped
$/backtick delimiters as real math or code syntax, so explicitly escaped literal examples can be transformed in HTML/PDF exports. - 🟡 MEDIUM — Display-math parsing is only handled by the top-level line walker; indented block equations under list items or nested structures can be emitted as sibling blocks and lose document structure.
This remains a standard-risk change affecting shared editor rendering and export behavior. The dev server is healthy, but browser executors again lacked navigation/DOM/screenshot tools; no live visual cases could be verified. Static/unit coverage exists for the main rendering and export paths, but not for these two new edge cases.
🧪 Browser testing: Could not verify — browser automation tools were unavailable in the executor environment; all planned cases were reported as environment-blocked.
Summary
Why
Content already parses inline$...$ and block $$ delimiters into structured NFM atoms, but those atoms were displayed as plain labels. This completes the presentation and export layers without changing the canonical source format or adding a second math grammar.
Validation
Notes
The local-file page actions menu does not expose HTML/PDF export, so export output is covered by focused integration tests rather than manual download QA.