import { Fragment } from "react"; // Render a small, safe subset of Discord Markdown; React escapes raw HTML. function inline(text: string) { return text .split(/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\(https?:\/\/[^\s)]+\))/g) .map((part, i) => { if (part.startsWith("**") && part.endsWith("**")) return {part.slice(2, -2)}; if (part.startsWith("`") && part.endsWith("`")) return {part.slice(1, -1)}; const link = /^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(part); if (link) return ( {link[1]} ); return {part}; }); } export function ReleaseNotes({ body }: { body: string }) { return body.split(/\r?\n\s*\r?\n/).map((block, i) => { const lines = block.split(/\r?\n/); if (lines.every((line) => /^\s*[-*]\s+/.test(line))) return ( ); return (

{lines.map((line, j) => ( {j > 0 &&
} {inline(line)}
))}

); }); }