diff --git a/format/markdown.go b/format/markdown.go index 03b231a..b1a3b37 100644 --- a/format/markdown.go +++ b/format/markdown.go @@ -34,7 +34,6 @@ var ( // Render renders the given markdown to HTML. func Render(markdown string) (htmlString string) { - markdown = strings.TrimLeft(strings.TrimSpace(strings.ReplaceAll(markdown, "\n", "
")), "
") var buf bytes.Buffer if err := Renderer.Convert([]byte(markdown), &buf); err != nil { return fmt.Sprintf("

Error rendering markdown: %s

", err) diff --git a/format/markdown_test.go b/format/markdown_test.go index 8c92778..08ad0e2 100644 --- a/format/markdown_test.go +++ b/format/markdown_test.go @@ -26,7 +26,7 @@ func TestRenderWithParagraphWrapping(t *testing.T) { func TestRenderWithMultipleParagraphs(t *testing.T) { md := "This is the first paragraph.\n\nThis is the second paragraph." - expected := "This is the first paragraph.

This is the second paragraph." + expected := "

This is the first paragraph.

\n

This is the second paragraph.

" got := Render(md) if got != expected {