From 7a512b1da60ca92203ec93ecce8b0debfe6da913 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 26 Dec 2022 12:04:09 +0530 Subject: markdown: more file exts, fix img --- routes/routes.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'routes') diff --git a/routes/routes.go b/routes/routes.go index 1034f2f..3124d1b 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -110,8 +110,11 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) { content, _ := gr.FileContent(readme) if len(content) > 0 { switch ext { - case ".md": - unsafe := blackfriday.Run([]byte(content), blackfriday.WithExtensions(blackfriday.CommonExtensions)) + case ".md", ".mkd", ".markdown": + unsafe := blackfriday.Run( + []byte(content), + blackfriday.WithExtensions(blackfriday.CommonExtensions), + ) html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) readmeContent = template.HTML(html) default: -- cgit