package markdown_test import ( "testing" "git.akyoto.dev/go/assert" "git.akyoto.dev/go/markdown" ) func TestEmpty(t *testing.T) { assert.Equal(t, markdown.Render(""), "") } func TestParagraph(t *testing.T) { assert.Equal(t, markdown.Render("Text"), "
Text
") assert.Equal(t, markdown.Render("Text\n"), "Text
") assert.Equal(t, markdown.Render("Text\n\n"), "Text
") assert.Equal(t, markdown.Render("Text\n\n\n"), "Text
") assert.Equal(t, markdown.Render("Line 1\nLine 2"), "Line 1 Line 2
") } func TestHeader(t *testing.T) { assert.Equal(t, markdown.Render("# Header"), "[text](https://example.com/
") assert.Equal(t, markdown.Render("[text]https://example.com/)"), "[text]https://example.com/)
") assert.Equal(t, markdown.Render("[text(https://example.com/)"), "[text(https://example.com/)
") assert.Equal(t, markdown.Render("text](https://example.com/)"), "text](https://example.com/)
") assert.Equal(t, markdown.Render("Prefix [text](https://example.com/) suffix."), "Prefix text suffix.
") } func TestCombined(t *testing.T) { assert.Equal(t, markdown.Render("# Header\nLine 1.\nLine 2.\nLine 3."), "Line 1. Line 2. Line 3.
") assert.Equal(t, markdown.Render("# Header 1\nLine 1.\n# Header 2\nLine 2."), "Line 1.
Line 2.
") assert.Equal(t, markdown.Render("# [Header Link](https://example.com/)"), "