fix footnote formatting

This commit is contained in:
Michael Teichgräber 2014-07-31 01:39:15 +02:00
parent 1c2705dcfe
commit 325ec6c40d
2 changed files with 9 additions and 1 deletions

View File

@ -198,7 +198,7 @@ func (w *troffOut) elem(elt *element, isFirst bool) *troffOut {
w.s(".FS\n")
w.skipPadding()
w.children(elt)
w.req("FE")
w.req("FE\n")
}
case REFERENCE:
/* Nonprinting */

View File

@ -269,15 +269,23 @@ func (w *htmlOut) elem(elt *element) *htmlOut {
}
func (w *htmlOut) printEndnotes() {
extraNewline := func() {
// add an extra newline to maintain
// compatibility with the C version.
w.padded--
}
counter := 0
w.s("<hr/>\n<ol id=\"notes\">")
for _, elt := range w.endNotes {
counter++
extraNewline()
w.br().s(fmt.Sprintf("<li id=\"fn%d\">\n", counter)).skipPadding()
w.children(elt)
w.s(fmt.Sprintf(" <a href=\"#fnref%d\" title=\"Jump back to reference\">[back]</a>", counter))
w.br().s("</li>")
}
extraNewline()
w.br().s("</ol>")
}