diff --git a/README.md b/README.md index 2d2dafc..a5be041 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A markdown renderer that supports only a subset of the CommonMark spec in order - Headers - Paragraphs - Quotes +- Separators - Tables ## Installation @@ -35,6 +36,7 @@ PASS: TestList PASS: TestTables PASS: TestCode PASS: TestQuote +PASS: TestSeparator PASS: TestCombined PASS: TestSecurity coverage: 100.0% of statements diff --git a/Render.go b/Render.go index 5037482..3c03851 100644 --- a/Render.go +++ b/Render.go @@ -117,6 +117,11 @@ func (r *renderer) processLine(line string) { return case '-', '*': + if strings.HasPrefix(line, "---") { + r.WriteString("
Line 1
Line 2 Line 3
Line 4
") } +func TestSeparator(t *testing.T) { + assert.Equal(t, markdown.Render("---"), "Line 1
Line 2
") +} + func TestCombined(t *testing.T) { assert.Equal(t, markdown.Render("# Header\n\nLine 1."), "Line 1.
") assert.Equal(t, markdown.Render("# Header\nLine 1.\nLine 2.\nLine 3."), "Line 1. Line 2. Line 3.
")