markdown: Default extensions .md, .markdown, and .mdown

This commit is contained in:
Matthew Holt 2015-11-10 22:39:27 -07:00
parent d46967d1e2
commit 51d2ff4e47
2 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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")
}
}