Add lossless inline-definition-footnote rendering for the OrgWriter

This commit is contained in:
Niklas Fasching 2018-12-02 17:24:10 +01:00
parent fc982125c9
commit a570fc736f
6 changed files with 49 additions and 29 deletions

View file

@ -14,6 +14,7 @@ type Footnotes struct {
type FootnoteDefinition struct {
Name string
Children []Node
Inline bool
}
var footnoteDefinitionRegexp = regexp.MustCompile(`^\[fn:([\w-]+)\]\s+(.+)`)
@ -33,6 +34,6 @@ 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.Definitions[name] = FootnoteDefinition{name, nodes}
d.Footnotes.Definitions[name] = FootnoteDefinition{name, nodes, false}
return consumed, nil
}