changeset 51:e054275d0938 draft

Add Markdown extensions to blackfriday
author prologic
date Sat, 23 Oct 2021 03:57:19 +0000
parents f7ad715c03ce
children befb74a09424
files main.go
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main.go	Fri Sep 17 23:45:01 2021 +0000
+++ b/main.go	Sat Oct 23 03:57:19 2021 +0000
@@ -182,7 +182,10 @@
 	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 {