preview.go 474 B

1234567891011121314151617
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package routers
  5. import "github.com/gogits/gogs/modules/middleware"
  6. func Preview(ctx *middleware.Context) {
  7. content := ctx.Query("content")
  8. // todo : gfm render content
  9. // content = Markdown(content)
  10. ctx.Render.JSON(200, map[string]interface{}{
  11. "ok": true,
  12. "content": "preview : " + content,
  13. })
  14. }