1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-12-02 18:57:51 +01:00
gojekyll/renderers/markdown_test.go

20 lines
705 B
Go
Raw Normal View History

2017-08-18 17:07:01 +02:00
package renderers
2017-08-11 23:16:49 +02:00
import (
"testing"
"github.com/stretchr/testify/require"
)
func renderMarkdownString(s string) string {
return string(renderMarkdown([]byte(s)))
}
func TestRenderMarkdown(t *testing.T) {
require.Equal(t, "<p><em>b</em></p>\n", renderMarkdownString("*b*"))
require.Equal(t, "<div>*b*</div>\n", renderMarkdownString("<div>*b*</div>"))
require.Equal(t, "<div a=1><p><em>b</em></p>\n</div>\n", renderMarkdownString(`<div a=1 markdown="1">*b*</div>`))
require.Equal(t, "<div a=1><p><em>b</em></p>\n</div>\n", renderMarkdownString(`<div a=1 markdown='1'>*b*</div>`))
require.Equal(t, "<div a=1><p><em>b</em></p>\n</div>\n", renderMarkdownString(`<div a=1 markdown=1>*b*</div>`))
}