Skip to content

Commit

Permalink
Move markdown file support before js handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasschlueter committed Nov 21, 2018
1 parent b23a7b3 commit 2171edb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions partial_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ func partialHelper(name string, data map[string]interface{}, help HelperContext)
help)
}

if strings.HasSuffix(name, ".md") {
part = string(github_flavored_markdown.Markdown([]byte(part)))
}

if ct, ok := help.Value("contentType").(string); ok {
if strings.Contains(ct, "javascript") && strings.HasSuffix(name, ".html") {
part = template.JSEscapeString(string(part))
}
if strings.Contains(ct, "markdown") || strings.HasSuffix(name, ".md") {
part = string(github_flavored_markdown.Markdown([]byte(part)))
}
}
return template.HTML(part), err
}

0 comments on commit 2171edb

Please sign in to comment.