Implemented code blocks

This commit is contained in:
2024-04-01 21:27:10 +02:00
parent e19a41c792
commit f75ea823a9
3 changed files with 50 additions and 2 deletions

View File

@ -49,6 +49,11 @@ func TestTables(t *testing.T) {
assert.Equal(t, markdown.Render("| 1 | 2 |\n| --- | --- |\n| 1 | 2 |"), "<table><thead><tr><th>1</th><th>2</th></tr></thead><tbody><tr><td>1</td><td>2</td></tr></tbody></table>")
}
func TestCode(t *testing.T) {
assert.Equal(t, markdown.Render("```\nText\n```"), "<pre><code>Text</code></pre>")
assert.Equal(t, markdown.Render("```go\ntype A struct {\n\t\n}\n```"), "<pre><code class=\"language-go\">type A struct {\n\t\n}</code></pre>")
}
func TestQuote(t *testing.T) {
assert.Equal(t, markdown.Render("> Line"), "<blockquote><p>Line</p></blockquote>")
assert.Equal(t, markdown.Render("> Line 1\n> Line 2"), "<blockquote><p>Line 1 Line 2</p></blockquote>")