From 4c11a2a62d104b7dc0bbe23c80b216628bee0e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytautas=20=C5=A0altenis?= Date: Wed, 30 Mar 2016 19:40:10 +0300 Subject: [PATCH] Expose Parse func that grabs input and returns AST --- markdown.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/markdown.go b/markdown.go index 7380cb2..af4dae0 100644 --- a/markdown.go +++ b/markdown.go @@ -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() {