diff --git a/org/document.go b/org/document.go index abd7099..a7eb2b6 100644 --- a/org/document.go +++ b/org/document.go @@ -68,9 +68,8 @@ var DefaultFrontMatterHandler = func(k, v string) interface{} { func NewDocument() *Document { return &Document{ Footnotes: &Footnotes{ - ExcludeHeading: true, - Title: "Footnotes", - Definitions: map[string]*FootnoteDefinition{}, + Title: "Footnotes", + Definitions: map[string]*FootnoteDefinition{}, }, AutoLink: true, MaxEmphasisNewLines: 1, diff --git a/org/footnote.go b/org/footnote.go index a4007b0..7032a22 100644 --- a/org/footnote.go +++ b/org/footnote.go @@ -5,10 +5,9 @@ import ( ) type Footnotes struct { - ExcludeHeading bool - Title string - Definitions map[string]*FootnoteDefinition - addOrder []string + Title string + Definitions map[string]*FootnoteDefinition + addOrder []string } type FootnoteDefinition struct { @@ -35,8 +34,9 @@ func (d *Document) parseFootnoteDefinition(i int, parentStop stopFn) (int, Node) d.tokens[i].kind == "headline" || d.tokens[i].kind == "footnoteDefinition" } consumed, nodes := d.parseMany(i, stop) - d.Footnotes.add(name, &FootnoteDefinition{name, nodes, false}) - return consumed, nil + definition := FootnoteDefinition{name, nodes, false} + d.Footnotes.add(name, &definition) + return consumed, definition } func (fs *Footnotes) add(name string, definition *FootnoteDefinition) { diff --git a/org/headline.go b/org/headline.go index c72bb2f..b9d56c4 100644 --- a/org/headline.go +++ b/org/headline.go @@ -68,9 +68,5 @@ func (d *Document) parseHeadline(i int, parentStop stopFn) (int, Node) { } } headline.Children = nodes - - if headline.Lvl == 1 && text == d.Footnotes.Title && d.Footnotes.ExcludeHeading { - return consumed + 1, nil - } return consumed + 1, headline } diff --git a/org/html.go b/org/html.go index 67fe739..d562345 100644 --- a/org/html.go +++ b/org/html.go @@ -11,7 +11,8 @@ import ( type HTMLWriter struct { stringBuilder - HighlightCodeBlock func(source, lang string) string + HighlightCodeBlock func(source, lang string) string + FootnotesHeadingTitle string } var emphasisTags = map[string][]string{ @@ -33,6 +34,7 @@ var listTags = map[string][]string{ func NewHTMLWriter() *HTMLWriter { return &HTMLWriter{ + FootnotesHeadingTitle: "Footnotes", HighlightCodeBlock: func(source, lang string) string { return fmt.Sprintf("%s\n
\n%s\n\n", `