Registry /
utility / yuin-goldmark-highlighting
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
highlighting
✓ github.com/yuin/goldmark-highlighting
Convert Markdown with syntax-highlighted code blocks.
package main
import (
"bytes"
"fmt"
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting"
)
func main() {
markdown := goldmark.New(
goldmark.WithExtensions(
highlighting.Highlighting,
),
)
var buf bytes.Buffer
source := []byte("```go\nfmt.Println(\"hello\")\n```")
if err := markdown.Convert(source, &buf); err != nil {
panic(err)
}
fmt.Println(buf.String())
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20220924101130-fa6e4c4a0d55latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.