1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-30 04:29:13 +01:00

Expose Parse func that grabs input and returns AST

This commit is contained in:
Vytautas Šaltenis 2016-03-30 19:40:10 +03:00
parent c1011c8ab2
commit 4c11a2a62d

View File

@ -390,7 +390,10 @@ func MarkdownOptions(input []byte, renderer Renderer, opts Options) []byte {
if renderer == nil {
return nil
}
return renderer.Render(Parse(input, opts))
}
func Parse(input []byte, opts Options) *Node {
extensions := opts.Extensions
// fill in the render structure
@ -450,7 +453,7 @@ func MarkdownOptions(input []byte, renderer Renderer, opts Options) []byte {
}
})
p.parseRefsToAST()
return renderer.Render(p.doc)
return p.doc
}
func (p *parser) parseRefsToAST() {