output.go: don't pad() for endnotes if there are none

This commit is contained in:
Michael Teichgräber 2010-11-24 19:17:50 +01:00
parent 42e0bf557e
commit e96ca46419

View File

@ -46,12 +46,13 @@ type htmlOut struct {
func (d *Doc) WriteHtml(w Writer) int { func (d *Doc) WriteHtml(w Writer) int {
out := new(htmlOut) out := new(htmlOut)
out.Writer = w out.Writer = w
out.padded = 2 out.padded = 2
out.elist(d.tree, false) out.elist(d.tree, false)
if len(out.endNotes) != 0 {
out.pad(2) out.pad(2)
out.printEndnotes() out.printEndnotes()
}
out.WriteByte('\n')
return 0 return 0
} }
@ -214,9 +215,6 @@ func (w *htmlOut) elem(elt *element, obfuscate bool) *htmlOut {
func (w *htmlOut) printEndnotes() { func (w *htmlOut) printEndnotes() {
counter := 0 counter := 0
if len(w.endNotes) == 0 {
return
}
w.s("<hr/>\n<ol id=\"notes\">") w.s("<hr/>\n<ol id=\"notes\">")
for _, elt := range w.endNotes { for _, elt := range w.endNotes {
counter++ counter++