Permet le rendu des fichiers html dans le navigateur

Afin d'ajouter réellement des fonctionnalités de blog, on peut rendre les fichiers html, css, js normalement sans pygments.

J'ai pas les moyens de tester si y a pas de bug, et je voulais soumettre l'idée rapidement.
This commit is contained in:
Melcore 2023-05-11 21:13:48 +00:00
parent ccfec0affc
commit 00a2df14ff
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,8 @@ def paste_to_html(filename, filecontents):
if filename.endswith(".md") or "." not in filename:
data["highlighted"] = markdown_to_html(filecontents)
return loader.render_to_string("paste/show-markdown.html", data)
elif filename.endswith(".html") or filename.endswith(".css") or filename.endswith(".js"):
return filecontents
else:
data["highlighted"] = pygmentize(filename, filecontents)
return loader.render_to_string("paste/show-pygments.html", data)