diff --git a/playground/run.go b/playground/run.go index 21e8d59..7346164 100644 --- a/playground/run.go +++ b/playground/run.go @@ -20,7 +20,6 @@ import ( "math/rand" "net/http" "os/exec" - "strings" "time" "github.com/b3log/wide/conf" @@ -163,8 +162,6 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { } oneRuneStr := string(r) - oneRuneStr = strings.Replace(oneRuneStr, "<", "<", -1) - oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1) buf.content += oneRuneStr @@ -201,8 +198,6 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { } oneRuneStr := string(r) - oneRuneStr = strings.Replace(oneRuneStr, "<", "<", -1) - oneRuneStr = strings.Replace(oneRuneStr, ">", ">", -1) buf.content += oneRuneStr @@ -214,7 +209,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { if now-outputTimeout >= buf.millisecond || len(buf.content) > outputBufMax || oneRuneStr == "\n" { channelRet["cmd"] = "run" - channelRet["output"] = "" + buf.content + "" + channelRet["output"] = buf.content buf = outputBuf{} // a new buffer