From 2e92f21e24e741d1ccd332ae3587a97b0e43adc3 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Wed, 15 Jun 2016 14:56:51 +1000 Subject: [PATCH] Revert "Make syntax highlighting optional" This reverts commit d597f04562aa72c86cc5e142ee3d5275ffde44b7. --- main.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 5f606fe..25f4326 100644 --- a/main.go +++ b/main.go @@ -2,13 +2,12 @@ package main import ( "fmt" + "github.com/dchest/uniuri" + "github.com/ewhal/pygments" "io" "io/ioutil" "net/http" "os" - - "github.com/dchest/uniuri" - "github.com/ewhal/pygments" ) const ( @@ -17,7 +16,6 @@ const ( LENGTH = 4 TEXT = "$ | curl -F 'p=<-' lang='python'" + ADDRESS + "\n" PORT = ":8080" - SYNTAX = false ) func check(err error) { @@ -70,12 +68,10 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), 500) } - if SYNTAX == true { - if param2 != "" { - highlight := pygments.Highlight(string(s), param2, "html", "full, style=autumn,linenos=True, lineanchors=True,anchorlinenos=True,", "utf-8") - io.WriteString(w, string(highlight)) + if param2 != "" { + highlight := pygments.Highlight(string(s), param2, "html", "full, style=autumn,linenos=True, lineanchors=True,anchorlinenos=True,", "utf-8") + io.WriteString(w, string(highlight)) - } } else { io.WriteString(w, string(s)) }