summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-26 12:04:09 +0530
committerLibravatar Anirudh Oppiliappan <x@icyphox.sh>2022-12-26 12:04:09 +0530
commit7a512b1da60ca92203ec93ecce8b0debfe6da913 (patch)
tree652257816e8c3e0db49dbe8a2cc80161d955cc57
parent49b8b292897031c0d60777edfca11867569b2ee6 (diff)
downloadlegit-7a512b1da60ca92203ec93ecce8b0debfe6da913.tar.gz
legit-7a512b1da60ca92203ec93ecce8b0debfe6da913.tar.bz2
legit-7a512b1da60ca92203ec93ecce8b0debfe6da913.zip
markdown: more file exts, fix img
-rw-r--r--routes/routes.go7
-rw-r--r--static/style.css4
2 files changed, 9 insertions, 2 deletions
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:
diff --git a/static/style.css b/static/style.css
index b8dd834..19c0891 100644
--- a/static/style.css
+++ b/static/style.css
@@ -162,6 +162,10 @@ a:hover {
padding: revert;
}
+.readme img {
+ max-width: 100%;
+}
+
.diff {
margin: 1rem 0 1rem 0;
padding: 1rem 0 1rem 0;