@ -17,7 +17,7 @@ all:
chmod +x ./dist/bin/$(NAME)
fmt:
@$(GO) -w $(shell find ./ -type f -name '*.go')
@$(GOFMT) -w $(shell find ./ -type f -name '*.go')
clean:
rm -rf ./dist/
@ -74,6 +74,10 @@ func PasteAddFromForm(form url.Values, db storage.DB, titleMaxLen int, bodyMaxLe
}
// Check syntax
if paste.Syntax == "" {
paste.Syntax = "plaintext"
syntaxOk := false
for _, name := range lexerNames {
if name == paste.Syntax {
@ -19,12 +19,12 @@
package web
import (
"embed"
"git.lcomrade.su/root/lenpaste/internal/config"
"git.lcomrade.su/root/lenpaste/internal/logger"
"git.lcomrade.su/root/lenpaste/internal/storage"
chromaLexers "github.com/alecthomas/chroma/lexers"
"html/template"
textTemplate "text/template"
)
@ -20,6 +20,7 @@ package web
"bytes"
"errors"
"fmt"
@ -27,7 +28,6 @@ import (
"path/filepath"
"strconv"
"strings"
type Locale map[string]string