Fix footnote ordering and some other bugs

This commit is contained in:
Niklas Fasching 2018-12-02 20:09:40 +01:00
parent b1f9bfc9e9
commit d5bf4317b2
7 changed files with 105 additions and 28 deletions

View file

@ -34,7 +34,7 @@ var listTags = map[string][]string{
func NewHTMLWriter() *HTMLWriter {
return &HTMLWriter{
HighlightCodeBlock: func(source, lang string) string {
return fmt.Sprintf("<pre>%s<pre>", html.EscapeString(source))
return fmt.Sprintf("<pre>%s</pre>", html.EscapeString(source))
},
}
}
@ -154,8 +154,8 @@ func (w *HTMLWriter) writeFootnotes(d *Document) {
w.WriteString(`<div id="footnotes">` + "\n")
w.WriteString(`<h1 class="footnotes-title">` + fs.Title + `</h1>` + "\n")
w.WriteString(`<div class="footnote-definitions">` + "\n")
for _, name := range fs.Order {
w.writeNodes(fs.Definitions[name])
for _, definition := range d.Footnotes.Ordered() {
w.writeNodes(definition)
}
w.WriteString("</div>\n</div>\n")
}