Add Markdown extensions to blackfriday

This commit is contained in:
James Mills 2021-10-23 13:57:19 +10:00
parent 054f525327
commit 40012efba4
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -182,7 +182,10 @@ func buildMarkdown(path string, w io.Writer, vars Vars) error {
if err != nil { if err != nil {
return err return err
} }
v["content"] = string(blackfriday.Run([]byte(content))) v["content"] = string(blackfriday.Run(
[]byte(content),
blackfriday.WithExtensions(blackfriday.CommonExtensions|blackfriday.AutoHeadingIDs),
))
if w == nil { if w == nil {
out, err := os.Create(filepath.Join(PUBDIR, renameExt(path, "", ".html"))) out, err := os.Create(filepath.Join(PUBDIR, renameExt(path, "", ".html")))
if err != nil { if err != nil {