fix: render markdown-style lists from MDX migration as proper HTML ul/li elements
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 10s
Build & Deploy / 🧪 QA (push) Successful in 2m19s
Build & Deploy / 🏗️ Build (push) Successful in 6m16s
Build & Deploy / 🚀 Deploy (push) Successful in 25s
Build & Deploy / 🧪 Post-Deploy Verification (push) Failing after 1m23s
Build & Deploy / ⚡ Performance & Accessibility (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-02-25 02:36:57 +01:00
parent d5da64cb76
commit 33f0238d58

View File

@@ -27,6 +27,24 @@ const jsxConverters: JSXConverters = {
return <span dangerouslySetInnerHTML={{ __html: text }} />;
}
// Handle markdown-style lists embedded in text nodes from MDX migration
if (text && text.includes('\n- ')) {
const parts = text.split('\n- ').filter(Boolean);
// If first part doesn't start with "- ", it's a prefix paragraph
const startsWithDash = text.trimStart().startsWith('- ');
const prefix = startsWithDash ? null : parts.shift();
return (
<>
{prefix && <span>{prefix}</span>}
<ul className="list-disc pl-6 my-4 space-y-2">
{parts.map((item: string, i: number) => (
<li key={i}>{item.trim()}</li>
))}
</ul>
</>
);
}
if (node.format === 1) return <strong>{text}</strong>;
if (node.format === 2) return <em>{text}</em>;
return <span>{text}</span>;