package views import ( "bytes" "context" "strings" "testing" ) func TestMarkdownSections(t *testing.T) { var buf bytes.Buffer src := "**Go for a run**: nice.\n**When:** now\n**The session:**\n- warm up\n- run\n**Route:** the loop" Markdown(src).Render(context.Background(), &buf) got := buf.String() if strings.Contains(got, "run\nRoute:") || !strings.Contains(got, "\n

Route:") { t.Errorf("Route folded into the list:\n%s", got) } if !strings.Contains(got, "

Go for a run: nice.

") { t.Errorf("first line mangled:\n%s", got) } }