markdown: more file exts, fix img
This commit is contained in:
parent
49b8b29289
commit
7a512b1da6
|
@ -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:
|
||||
|
|
|
@ -162,6 +162,10 @@ a:hover {
|
|||
padding: revert;
|
||||
}
|
||||
|
||||
.readme img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.diff {
|
||||
margin: 1rem 0 1rem 0;
|
||||
padding: 1rem 0 1rem 0;
|
||||
|
|
Loading…
Reference in New Issue