~artemis/paste

0adc548bb434c794440522be34ee5d4f281e307a — Diane 3 years ago daa62cb
Added text trimming
2 files changed, 4 insertions(+), 3 deletions(-)

M handlers.go
M todo.txt
M handlers.go => handlers.go +3 -2
@@ 5,6 5,7 @@ import (
	"html/template"
	"net/http"
	"net/url"
	"strings"
	"time"

	"github.com/gorilla/mux"


@@ 141,8 142,8 @@ func (h Handlers) handleAbout(w http.ResponseWriter, req *http.Request) {
// PasteSubmit schema, And fills a PasteSubmit command with associated values
func ValidateAndTransformPasteSubmitCommand(form url.Values) (
	PasteSubmitCommand, validator.Errors) {
	values, validationErrors := validator.Validator{Schema: PasteSubmitSchema}.
		Validate(form)
	form.Set("paste", strings.TrimSpace(form.Get("paste")))
	values, validationErrors := validator.Validator{Schema: PasteSubmitSchema}.Validate(form)

	command := PasteSubmitCommand{
		Paste:          values.Get("paste"),

M todo.txt => todo.txt +1 -1
@@ 1,4 1,4 @@
text trimming on paste
x 2020-06-21 text trimming on paste
uniformized error pages
server-side syntaxic coloration
x 2020-06-21 mode changer