diff --git a/website/src/pages/blog/[...slug].astro b/website/src/pages/blog/[...slug].astro index 4fe82c2..86cdcfe 100644 --- a/website/src/pages/blog/[...slug].astro +++ b/website/src/pages/blog/[...slug].astro @@ -52,9 +52,18 @@ const GemtextHTMLRenderer: Gemtext.Renderer = { } }; +function postProcessGemtextToHtml(html: string): string { + html = mergeAdjacentBlockquotes(html); + return html; +} + +function mergeAdjacentBlockquotes(html: string): string { + return html.replaceAll(/\<\/blockquote\>\/gm, '
'); +} + const post = Astro.props; const Content = post.filePath?.endsWith('.gmi') - ? Gemtext.parse((post.body ?? '').replace(`# ${post.data.title}`, '')).generate(GemtextHTMLRenderer) + ? postProcessGemtextToHtml(Gemtext.parse((post.body ?? '').replace(`# ${post.data.title}`, '')).generate(GemtextHTMLRenderer)) : (await render(post)).Content; ---