Created
August 25, 2014 05:59
-
-
Save slav123/aa1408f384523330ff1e to your computer and use it in GitHub Desktop.
<form action="/generate" method="POST"> <textarea name="body" cols="30" rows="10"></textarea> <button>Submit</button>
</form>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/codegangsta/martini" | |
"github.com/russross/blackfriday" | |
"net/http" | |
) | |
func main() { | |
m := martini.Classic() | |
m.Post("/generate", func(r *http.Request) []byte { | |
body := r.FormValue("body") | |
return blackfriday.MarkdownBasic([]byte(body)) | |
}) | |
m.Run() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment