feat: GFM + hard line breaks for single newlines

Goldmark now uses GFM extension and WithHardWraps so single
newlines in markdown render as <br> instead of collapsing.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>
This commit is contained in:
2026-06-24 16:49:05 +03:00
parent 723fc7deb8
commit 361e3f331d

View File

@@ -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
}