You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
497 B

  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 v1
  5. import (
  6. "github.com/gogits/gogs/modules/base"
  7. "github.com/gogits/gogs/modules/middleware"
  8. )
  9. func Markdown(ctx *middleware.Context) {
  10. content := ctx.Query("content")
  11. ctx.Render.JSON(200, map[string]interface{}{
  12. "ok": true,
  13. "content": string(base.RenderMarkdown([]byte(content), ctx.Query("repoLink"))),
  14. })
  15. }