fix(DocDialog): Render doc bodies as markdown
DocContent rendered the raw body in a whitespace-pre-wrap div, so
markdown syntax and fenced code blocks appeared literally. Parse
through the shared markdown pipeline and style with prose.
Wrap the content in an <article> so md-bg and md-border, which
resolve element.closest("article"), get a valid style target
instead of throwing.
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from "solid-js";
|
||||
import { docEntries, type DocEntry } from "./doc-data";
|
||||
import { journalDocEntries, type JournalDocEntry } from "./journal-doc-data";
|
||||
import { parseMarkdown } from "../markdown";
|
||||
|
||||
type DocSet = "directives" | "journal";
|
||||
type AnyEntry = DocEntry | JournalDocEntry;
|
||||
@@ -166,9 +167,10 @@ const DocContent: Component<{ entry: AnyEntry }> = (props) => {
|
||||
{e.icon} {e.title}
|
||||
</h2>
|
||||
|
||||
<div class="text-sm leading-relaxed whitespace-pre-wrap text-gray-800">
|
||||
{e.body}
|
||||
</div>
|
||||
<article
|
||||
class="prose prose-sm max-w-none text-gray-800"
|
||||
innerHTML={parseMarkdown(e.body)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user