Skip to content

Instantly share code, notes, and snippets.

@anarcher
Last active December 10, 2015 06:28
Show Gist options
  • Save anarcher/4395139 to your computer and use it in GitHub Desktop.
Save anarcher/4395139 to your computer and use it in GitHub Desktop.
markdown-example.go
package main
import "github.com/knieriem/markdown"
import "strings"
import "fmt"
import "bytes"
func main() {
s := `
## Test
- Test
- Test
`
fmt.Println("input:",s)
p := markdown.NewParser(&markdown.Extensions{ Smart: true })
b := new(bytes.Buffer)
p.Markdown(strings.NewReader(s),markdown.ToHTML(b))
fmt.Println("output:",b.String())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment