fix: changelog page rendered literal **bold** markup instead of bold text

Entries are plain strings with occasional **bold**/`code` spans, never
full markdown — added a tiny inline parser rather than pulling in
react-markdown just for this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-13 13:26:38 +02:00
parent 2beb23b360
commit 6dd48b5c25
5 changed files with 40 additions and 6 deletions
+25 -3
View File
@@ -1,7 +1,29 @@
import { Fragment } from "react";
import { Badge } from "@/components/ui/badge";
import { Separator } from "@/components/ui/separator";
import { CHANGELOG } from "@/lib/changelog";
// Changelog entries are plain strings with occasional **bold** and `code`
// spans — never full markdown (lists, links, headings) — so a tiny inline
// parser is enough and keeps this off the react-markdown dependency used for
// full AI chat output elsewhere.
function InlineMarkdown({ text }: { text: string }) {
const parts = text.split(/(\*\*[^*]+\*\*|`[^`]+`)/g).filter(Boolean);
return (
<>
{parts.map((part, i) => {
if (part.startsWith("**") && part.endsWith("**")) {
return <strong key={i}>{part.slice(2, -2)}</strong>;
}
if (part.startsWith("`") && part.endsWith("`")) {
return <code key={i} className="rounded bg-muted px-1 py-0.5 text-xs">{part.slice(1, -1)}</code>;
}
return <Fragment key={i}>{part}</Fragment>;
})}
</>
);
}
export function ChangelogList() {
return (
<div className="space-y-8 max-w-2xl">
@@ -18,7 +40,7 @@ export function ChangelogList() {
<div className="space-y-1.5">
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">Added</p>
<ul className="space-y-1 text-sm list-disc pl-5">
{entry.added.map((line, j) => <li key={j}>{line}</li>)}
{entry.added.map((line, j) => <li key={j}><InlineMarkdown text={line} /></li>)}
</ul>
</div>
)}
@@ -27,7 +49,7 @@ export function ChangelogList() {
<div className="space-y-1.5">
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">Fixed</p>
<ul className="space-y-1 text-sm list-disc pl-5">
{entry.fixed.map((line, j) => <li key={j}>{line}</li>)}
{entry.fixed.map((line, j) => <li key={j}><InlineMarkdown text={line} /></li>)}
</ul>
</div>
)}
@@ -36,7 +58,7 @@ export function ChangelogList() {
<div className="space-y-1.5">
<p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">Security</p>
<ul className="space-y-1 text-sm list-disc pl-5">
{entry.security.map((line, j) => <li key={j}>{line}</li>)}
{entry.security.map((line, j) => <li key={j}><InlineMarkdown text={line} /></li>)}
</ul>
</div>
)}