]> Nishi Git Mirror - aya.git/commitdiff
Add Markdown extensions to blackfriday
authorJames Mills <prologic@shortcircuit.net.au>
Sat, 23 Oct 2021 03:57:19 +0000 (13:57 +1000)
committerJames Mills <prologic@shortcircuit.net.au>
Sat, 23 Oct 2021 03:57:19 +0000 (13:57 +1000)
main.go

diff --git a/main.go b/main.go
index fcea4451b7565ac28dd979d3ac579c4e00b56cf9..49657aa8d925f1c2ffd69a88b2cff8915a44a457 100644 (file)
--- a/main.go
+++ b/main.go
@@ -182,7 +182,10 @@ func buildMarkdown(path string, w io.Writer, vars Vars) error {
        if err != nil {
                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 {
                out, err := os.Create(filepath.Join(PUBDIR, renameExt(path, "", ".html")))
                if err != nil {