aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-29 21:16:06 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-29 21:16:06 +0800
commitecce694d77756264864b03e6b06077592ed1676a (patch)
treee5bf86b7be0cacc065e940fb5dfcffac2242b347 /routers
parent035facc5641e879b693982f6f4ada1d82915da82 (diff)
downloadgitea-ecce694d77756264864b03e6b06077592ed1676a.tar.gz
gitea-ecce694d77756264864b03e6b06077592ed1676a.zip
issue content ajax preview
Diffstat (limited to 'routers')
-rw-r--r--routers/preview.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/routers/preview.go b/routers/preview.go
new file mode 100644
index 0000000000..cc34c8fa02
--- /dev/null
+++ b/routers/preview.go
@@ -0,0 +1,17 @@
+// Copyright 2014 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package routers
+
+import "github.com/gogits/gogs/modules/middleware"
+
+func Preview(ctx *middleware.Context) {
+ content := ctx.Query("content")
+ // todo : gfm render content
+ // content = Markdown(content)
+ ctx.Render.JSON(200, map[string]interface{}{
+ "ok": true,
+ "content": "preview : " + content,
+ })
+}