From e96ca46419050590371f03e928841c9b04f9663d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Wed, 24 Nov 2010 19:17:50 +0100 Subject: [PATCH] output.go: don't pad() for endnotes if there are none --- output.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/output.go b/output.go index e83142f..201fa96 100644 --- a/output.go +++ b/output.go @@ -46,12 +46,13 @@ type htmlOut struct { func (d *Doc) WriteHtml(w Writer) int { out := new(htmlOut) out.Writer = w - out.padded = 2 out.elist(d.tree, false) - out.pad(2) - out.printEndnotes() - + if len(out.endNotes) != 0 { + out.pad(2) + out.printEndnotes() + } + out.WriteByte('\n') return 0 } @@ -214,9 +215,6 @@ func (w *htmlOut) elem(elt *element, obfuscate bool) *htmlOut { func (w *htmlOut) printEndnotes() { counter := 0 - if len(w.endNotes) == 0 { - return - } w.s("
\n
    ") for _, elt := range w.endNotes { counter++