diff options
Diffstat (limited to 'website')
| -rw-r--r-- | website/src/pages/blog/[...slug].astro | 11 |
1 files changed, 10 insertions, 1 deletions
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<string> = { } }; +function postProcessGemtextToHtml(html: string): string { + html = mergeAdjacentBlockquotes(html); + return html; +} + +function mergeAdjacentBlockquotes(html: string): string { + return html.replaceAll(/\<\/blockquote\>\<blockquote\>/gm, '<br>'); +} + 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; --- |
