markdown: more file exts, fix img
This commit is contained in:
parent
49b8b29289
commit
7a512b1da6
2 changed files with 9 additions and 2 deletions
|
@ -110,8 +110,11 @@ func (d *deps) RepoIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
content, _ := gr.FileContent(readme)
|
content, _ := gr.FileContent(readme)
|
||||||
if len(content) > 0 {
|
if len(content) > 0 {
|
||||||
switch ext {
|
switch ext {
|
||||||
case ".md":
|
case ".md", ".mkd", ".markdown":
|
||||||
unsafe := blackfriday.Run([]byte(content), blackfriday.WithExtensions(blackfriday.CommonExtensions))
|
unsafe := blackfriday.Run(
|
||||||
|
[]byte(content),
|
||||||
|
blackfriday.WithExtensions(blackfriday.CommonExtensions),
|
||||||
|
)
|
||||||
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
|
||||||
readmeContent = template.HTML(html)
|
readmeContent = template.HTML(html)
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -162,6 +162,10 @@ a:hover {
|
||||||
padding: revert;
|
padding: revert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.readme img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.diff {
|
.diff {
|
||||||
margin: 1rem 0 1rem 0;
|
margin: 1rem 0 1rem 0;
|
||||||
padding: 1rem 0 1rem 0;
|
padding: 1rem 0 1rem 0;
|
||||||
|
|
Loading…
Reference in a new issue