diff --git a/caddy/setup/markdown.go b/caddy/setup/markdown.go index f3c813db..27ac14a5 100644 --- a/caddy/setup/markdown.go +++ b/caddy/setup/markdown.go @@ -78,9 +78,9 @@ func markdownParse(c *Controller) ([]*markdown.Config, error) { } } - // If no extensions were specified, assume .md + // If no extensions were specified, assume some defaults if len(md.Extensions) == 0 { - md.Extensions = []string{".md"} + md.Extensions = []string{".md", ".markdown", ".mdown"} } mdconfigs = append(mdconfigs, md) diff --git a/caddy/setup/markdown_test.go b/caddy/setup/markdown_test.go index 5bf012b0..e562678e 100644 --- a/caddy/setup/markdown_test.go +++ b/caddy/setup/markdown_test.go @@ -37,8 +37,8 @@ func TestMarkdown(t *testing.T) { if myHandler.Configs[0].PathScope != "/blog" { t.Errorf("Expected /blog as the Path Scope") } - if fmt.Sprint(myHandler.Configs[0].Extensions) != fmt.Sprint([]string{".md"}) { - t.Errorf("Expected .md as the Default Extension") + if fmt.Sprint(myHandler.Configs[0].Extensions) != fmt.Sprint([]string{".md", ".markdown", ".mdown"}) { + t.Errorf("Expected .md, .markdown, and .mdown as default extensions") } }