git-preview @ main

static git web frontend but with images and html previews + code truncation

routes: sanitize readme content for non markdown files
Thu, 16 Jan 2025
1 files changed, 2 insertions(+), 1 deletions(-)
M routes/routes.go

@@ -121,8 +121,9 @@ )

html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) readmeContent = template.HTML(html) default: + safe := bluemonday.UGCPolicy().SanitizeBytes([]byte(content)) readmeContent = template.HTML( - fmt.Sprintf(`<pre>%s</pre>`, content), + fmt.Sprintf(`<pre>%s</pre>`, safe), ) } break