all repos — grayfriday @ c1011c8ab22a8f6d401f5b6a3f67aed5f6b1362b

blackfriday fork with a few changes

Remove unneeded reference to Renderer from parser
Vytautas Ĺ altenis vytas@rtfb.lt
Wed, 30 Mar 2016 19:35:53 +0300
commit

c1011c8ab22a8f6d401f5b6a3f67aed5f6b1362b

parent

4d74c6a07120697f918d6fb4b90a2d3ee3355665

1 files changed, 0 insertions(+), 9 deletions(-)

jump to
M markdown.gomarkdown.go

@@ -218,7 +218,6 @@

// 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 @@ extensions := opts.Extensions

// 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,28 +567,21 @@ }

// 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")