markdown: more file exts, fix img
Anirudh Oppiliappan x@icyphox.sh
Mon, 26 Dec 2022 12:04:09 +0530
2 files changed,
9 insertions(+),
2 deletions(-)
M
routes/routes.go
→
routes/routes.go
@@ -110,8 +110,11 @@ ext := filepath.Ext(readme)
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:
M
static/style.css
→
static/style.css
@@ -162,6 +162,10 @@ .readme ul {
padding: revert; } +.readme img { + max-width: 100%; +} + .diff { margin: 1rem 0 1rem 0; padding: 1rem 0 1rem 0;