package main import ( "bytes" // "fmt" ofm "code.ndumas.com/ndumas/obsidian-markdown/goldmark" "github.com/yuin/goldmark" "github.com/yuin/goldmark/parser" ) func main() { m := goldmark.New(goldmark.WithExtensions( ofm.ObsidianLinkExtension, )) source := ` # Hello goldmark-extensions this is a [[wikilink]] in text [[wikilink]] starting a line ending a line with a [[wikilink]] ` var buf bytes.Buffer context := parser.NewContext() err := m.Convert([]byte(source), &buf, parser.WithContext(context)) if err != nil { panic(err) } // fmt.Printf("%#+v\n", context) }