hellux/jotdown

Emit Footnotes as they are encountered

hellux opened this issue · 0 comments

All footnote events are currently emitted at the end of the document, in the order they are referenced. The reason for this is that the block elements are already stored in the block tree, so we can just skip it and parse and render it at the end. The alternative option is for the renderer to store the parsed result and render that at the end.

The current approach is problematic if the original order and location is needed. E.g. a pretty-printer would now be forced to place all footnotes at the end.

The current approach is also impossible for a single-pass parser, which we are trying to move to.

This is related to #14, both trying to achieve better 1:1 ratio between input and events.