Release 0.2.2: Philosophy.jsx now renders mermaid (uses MarkdownPreview)

Philosophy.jsx parsed PHILOSOPHY.md with bare marked + dangerouslySet
InnerHTML, so ```mermaid fences fell through as <pre> blocks. Swapped
to MarkdownPreview, which already carries the lazy mermaid loader +
SVG render path used by the RFC body view. Pre-existing gap, surfaced
when an OHM deployment authored a mermaid block in its PHILOSOPHY_PATH
override.

PATCH per SPEC §20.2 — additive, no operator action required beyond
the routine rebuild + restart.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ben Stull
2026-05-26 13:31:49 -07:00
parent 0e1805b8ce
commit 018e323ed4
4 changed files with 23 additions and 6 deletions
+19
View File
@@ -23,6 +23,25 @@ skip versions are the composition of each intervening adjacent
release's steps in order — no A-to-B path is pre-computed beyond release's steps in order — no A-to-B path is pre-computed beyond
that. that.
## 0.2.2 — 2026-05-26
**Patch — no operator action required.** Rebuild the frontend and
restart per the routine deploy steps; no `.env` changes, no schema
changes, no behavior changes a deployment would notice in steady
state beyond the fix below.
### Fixed
- **Mermaid blocks rendered as raw code on `/philosophy`.**
`frontend/src/components/Philosophy.jsx` parsed PHILOSOPHY.md with
the bare `marked` import and `dangerouslySetInnerHTML`, so
```` ```mermaid ```` fences fell through as `<pre>` blocks rather
than rendered diagrams. Swapped to `MarkdownPreview`, which already
carries the lazy mermaid loader + SVG render path used by the RFC
body view, so the philosophy surface now renders mermaid the same
way RFC bodies do. Pre-existing gap, surfaced when a deployment
authored a mermaid block in its `PHILOSOPHY_PATH` override.
## 0.2.1 — 2026-05-26 ## 0.2.1 — 2026-05-26
**Patch — no operator action required.** Rebuild the frontend and **Patch — no operator action required.** Rebuild the frontend and
+1 -1
View File
@@ -1 +1 @@
0.2.1 0.2.2
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "rfc-app-frontend", "name": "rfc-app-frontend",
"private": true, "private": true,
"version": "0.2.1", "version": "0.2.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+2 -4
View File
@@ -15,7 +15,7 @@
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { Link, useNavigate } from 'react-router-dom' import { Link, useNavigate } from 'react-router-dom'
import { marked } from 'marked' import MarkdownPreview from './MarkdownPreview.jsx'
import { getPhilosophy } from '../api.js' import { getPhilosophy } from '../api.js'
export default function Philosophy({ authenticated }) { export default function Philosophy({ authenticated }) {
@@ -33,8 +33,6 @@ export default function Philosophy({ authenticated }) {
return () => { active = false } return () => { active = false }
}, []) }, [])
const html = body ? marked.parse(body) : ''
return ( return (
<div className="philosophy-page"> <div className="philosophy-page">
<header className="philosophy-header"> <header className="philosophy-header">
@@ -53,7 +51,7 @@ export default function Philosophy({ authenticated }) {
{loading && <p className="muted">Loading</p>} {loading && <p className="muted">Loading</p>}
{error && <p className="error">Could not load the philosophy: {error}</p>} {error && <p className="error">Could not load the philosophy: {error}</p>}
{!loading && !error && ( {!loading && !error && (
<div dangerouslySetInnerHTML={{ __html: html }} /> <MarkdownPreview content={body} />
)} )}
</article> </article>
</div> </div>