fix syntax highlighting for fileview

このコミットが含まれているのは:
Arya Kiran 2023-03-09 15:26:32 +05:30
コミット 96c9c8501e
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 842D12BDA50DF120
2個のファイルの変更3行の追加9行の削除

ファイルの表示

@ -4,13 +4,12 @@ import (
"bufio"
"bytes"
"context"
"html/template"
htmlfmt "github.com/alecthomas/chroma/v2/formatters/html"
"github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
"github.com/carlmjohnson/requests"
"github.com/gofiber/fiber/v2"
"html/template"
)
// FileView is the file view page
@ -27,7 +26,7 @@ func FileView(c *fiber.Ctx) error {
})
}
lexer := lexers.Match(c.Params("file"))
lexer := lexers.Match(c.Params("+"))
if lexer == nil {
lexer = lexers.Fallback
}
@ -56,7 +55,6 @@ func FileView(c *fiber.Ctx) error {
writer.Flush()
cssw.Flush()
return c.Render("file", fiber.Map{
"file": template.HTML(buf.String()),
"css": template.CSS(cssbuf.String()),

ファイルの表示

@ -3,11 +3,7 @@
<main>
{{ if .file }}
<style>
{
{
.css;
}
}
{{.css}};
</style>
<div class="downloadParent">
<a href="/{{.fullname}}" class="button">Back to {{.fullname}}</a>