mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-25 18:37:47 +02:00
do not display files bigger than 1mo
This commit is contained in:
@@ -48,6 +48,8 @@ class Anonymous_Github:
|
|||||||
for term in terms:
|
for term in terms:
|
||||||
content = content.replace(term, "XXX")
|
content = content.replace(term, "XXX")
|
||||||
return content
|
return content
|
||||||
|
if file.size > 1000000:
|
||||||
|
return Markup("The file %s is too big please download it: <a href='%s'>Download %s</a>" % (file.name, file.url, file.name))
|
||||||
if ".md" in file.name:
|
if ".md" in file.name:
|
||||||
return Markup("<div class='markdown-body'>%s</div>" % removeTerms(self.github.render_markdown(file.decoded_content), terms))
|
return Markup("<div class='markdown-body'>%s</div>" % removeTerms(self.github.render_markdown(file.decoded_content), terms))
|
||||||
if ".jpg" in file.name or ".png" in file.name or ".png" in file.name or ".gif" in file.name:
|
if ".jpg" in file.name or ".png" in file.name or ".png" in file.name or ".gif" in file.name:
|
||||||
|
|||||||
Reference in New Issue
Block a user