1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-12-02 17:17:49 +01:00
gojekyll/pipelines/markdown_test.go

20 lines
705 B
Go
Raw Normal View History

2017-08-11 23:16:49 +02:00
package pipelines
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>`))
}