From c1011c8ab22a8f6d401f5b6a3f67aed5f6b1362b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytautas=20=C5=A0altenis?= Date: Wed, 30 Mar 2016 19:35:53 +0300 Subject: [PATCH] Remove unneeded reference to Renderer from parser --- markdown.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/markdown.go b/markdown.go index b000220..7380cb2 100644 --- a/markdown.go +++ b/markdown.go @@ -218,7 +218,6 @@ type inlineParser func(p *parser, data []byte, offset int) int // Parser holds runtime state used by the parser. // This is constructed by the Markdown function. type parser struct { - r Renderer refOverride ReferenceOverrideFunc refs map[string]*reference inlineCallback [256]inlineParser @@ -396,7 +395,6 @@ func MarkdownOptions(input []byte, renderer Renderer, opts Options) []byte { // fill in the render structure p := new(parser) - p.r = renderer p.flags = extensions p.refOverride = opts.ReferenceOverride p.refs = make(map[string]*reference) @@ -569,29 +567,22 @@ func firstPass(p *parser, input []byte) []byte { // second pass: actual rendering func secondPass(p *parser, input []byte) { - p.r.DocumentHeader() p.block(input) if p.flags&Footnotes != 0 && len(p.notes) > 0 { - p.r.BeginFootnotes() flags := ListItemBeginningOfList for i := 0; i < len(p.notes); i += 1 { ref := p.notes[i] - var buf bytes.Buffer if ref.hasBlock { flags |= ListItemContainsBlock p.block(ref.title) } else { p.inline(ref.title) } - p.r.FootnoteItem(ref.link, buf.Bytes(), flags) flags &^= ListItemBeginningOfList | ListItemContainsBlock } - p.r.EndFootnotes() } - p.r.DocumentFooter() - if p.nesting != 0 { panic("Nesting level did not end at zero") }