From 38e16a46583c96de5eef88c6225e099bac434be7 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 31 Jul 2015 11:39:08 +0800 Subject: [PATCH] Playground output escape --- playground/run.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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