diff --git a/markdown.go b/markdown.go index 337e289..bbc3db5 100644 --- a/markdown.go +++ b/markdown.go @@ -72,6 +72,11 @@ type Formatter interface { func (p *Parser) Markdown(src io.Reader, f Formatter) { s := p.preformat(src) + // this should not be necessary; + // investigation is needed to understand + // why the buffer sometimes is not empty + p.yy.ResetBuffer("") + p.parseRule(ruleReferences, s) if p.yy.extension.Notes { p.parseRule(ruleNotes, s)