diff --git a/html.go b/html.go
index 2169353..0b375bf 100644
--- a/html.go
+++ b/html.go
@@ -342,12 +342,14 @@ func (options *Html) TableCell(out *bytes.Buffer, text []byte, align int) {
out.WriteString("")
}
-func (options *Html) Footnotes(out *bytes.Buffer, text func()) {
+func (options *Html) BeginFootnotes(out *bytes.Buffer) {
out.WriteString("
\n")
}
diff --git a/latex.go b/latex.go
index c3f10a9..7f92903 100644
--- a/latex.go
+++ b/latex.go
@@ -168,8 +168,11 @@ func (options *Latex) TableCell(out *bytes.Buffer, text []byte, align int) {
}
// TODO: this
-func (options *Latex) Footnotes(out *bytes.Buffer, text func()) {
+func (r *Latex) BeginFootnotes(out *bytes.Buffer) {
+}
+// TODO: this
+func (r *Latex) EndFootnotes(out *bytes.Buffer) {
}
func (options *Latex) FootnoteItem(out *bytes.Buffer, name, text []byte, flags ListType) {
diff --git a/markdown.go b/markdown.go
index a4c03ab..caac06d 100644
--- a/markdown.go
+++ b/markdown.go
@@ -175,7 +175,8 @@ type Renderer interface {
TableRow(out *bytes.Buffer, text []byte)
TableHeaderCell(out *bytes.Buffer, text []byte, flags int)
TableCell(out *bytes.Buffer, text []byte, flags int)
- Footnotes(out *bytes.Buffer, text func())
+ BeginFootnotes(out *bytes.Buffer)
+ EndFootnotes(out *bytes.Buffer)
FootnoteItem(out *bytes.Buffer, name, text []byte, flags ListType)
TitleBlock(out *bytes.Buffer, text []byte)
@@ -456,21 +457,21 @@ func secondPass(p *parser, input []byte) []byte {
p.block(&output, input)
if p.flags&Footnotes != 0 && len(p.notes) > 0 {
- p.r.Footnotes(&output, func() {
- 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(&buf, ref.title)
- } else {
- p.inline(&buf, ref.title)
- }
- p.r.FootnoteItem(&output, ref.link, buf.Bytes(), flags)
- flags &^= ListItemBeginningOfList | ListItemContainsBlock
+ p.r.BeginFootnotes(&output)
+ 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(&buf, ref.title)
+ } else {
+ p.inline(&buf, ref.title)
}
- })
+ p.r.FootnoteItem(&output, ref.link, buf.Bytes(), flags)
+ flags &^= ListItemBeginningOfList | ListItemContainsBlock
+ }
+ p.r.EndFootnotes(&output)
}
p.r.DocumentFooter(&output)