From 361e3f331d0bf062df2cee1c30092fa5d71f6d35 Mon Sep 17 00:00:00 2001 From: Pierre De Lancre Date: Wed, 24 Jun 2026 16:49:05 +0300 Subject: [PATCH] feat: GFM + hard line breaks for single newlines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Goldmark now uses GFM extension and WithHardWraps so single newlines in markdown render as
instead of collapsing. 👾 Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code --- blog/store.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/blog/store.go b/blog/store.go index 0be98a4..de5c83f 100644 --- a/blog/store.go +++ b/blog/store.go @@ -10,6 +10,13 @@ import ( "time" "github.com/yuin/goldmark" + "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/renderer/html" +) + +var md = goldmark.New( + goldmark.WithExtensions(extension.GFM), + goldmark.WithRendererOptions(html.WithHardWraps()), ) type Post struct { @@ -52,7 +59,7 @@ func (s *Store) Load(dir string) error { title, body, date := parseFrontMatter(raw, slug, path) var buf bytes.Buffer - if err := goldmark.Convert(body, &buf); err != nil { + if err := md.Convert(body, &buf); err != nil { continue }