Last active
December 10, 2021 05:26
-
-
Save kjk/ca065f34cd03d9f8734f7fb1d147d58d to your computer and use it in GitHub Desktop.
gomarkdown example for #216 (made with https://codeeval.dev)
This file contains 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 ( | |
"fmt" | |
"github.com/gomarkdown/markdown" | |
"github.com/gomarkdown/markdown/parser" | |
) | |
const md = ` | |
- [level-1-b](#level-1) | |
- [level-2-a](#level-2) | |
- [level-3-a](#level-3-a) | |
- [level-2-b](#level-2) | |
` | |
func main() { | |
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | |
parser := parser.NewWithExtensions(extensions) | |
html := markdown.ToHTML([]byte(md), parser, nil) | |
fmt.Printf("html:\n%s\n", string(html)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment