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
1 changed files with 4 additions and 1 deletions

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() {