diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-21 14:16:03 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2025-12-21 14:16:03 +0100 |
| commit | 5ff5db6770a4cd7f506121287070fb342de62e79 (patch) | |
| tree | 2a244fe4a52170754f80c3cca1554a4c6c185e5e /markdown/ast_paragraph_test.go | |
| parent | b8b0189bab9e282624fcf64d622cf100f3ddec11 (diff) | |
feat(markdown): option to render poem
Diffstat (limited to 'markdown/ast_paragraph_test.go')
| -rw-r--r-- | markdown/ast_paragraph_test.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/markdown/ast_paragraph_test.go b/markdown/ast_paragraph_test.go index ab3ab6c..c18dfc7 100644 --- a/markdown/ast_paragraph_test.go +++ b/markdown/ast_paragraph_test.go @@ -7,10 +7,18 @@ func TestParagraph(t *testing.T) { t.Run("simple", test("bonsoir", `<p>bonsoir</p>`)) }) t.Run("replacer", func(t *testing.T) { - opt := &Option{ - Replaces: map[rune]string{'~': " "}, - } + opt := &Option{Replaces: map[rune]string{'~': " "}} t.Run("empty", testWithOptions(opt, "bonsoir", `<p>bonsoir</p>`)) t.Run("simple", testWithOptions(opt, "bonsoir~!", `<p>bonsoir !</p>`)) }) + t.Run("poem", func(t *testing.T) { + opt := &Option{Poem: true} + t.Run("simple", testWithOptions(opt, "bonsoir", `<p>bonsoir</p>`)) + t.Run("one_break", testWithOptions(opt, `bonsoir +world`, `<p>bonsoir<br />world</p>`)) + t.Run("mult_break", testWithOptions(opt, `bonsoir +world + +new line`, `<p>bonsoir<br />world</p><p>new line</p>`)) + }) } |
