diff options
Diffstat (limited to 'lib/documents.js')
| -rw-r--r-- | lib/documents.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/documents.js b/lib/documents.js index 135e229..86e0709 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -15,7 +15,7 @@ function Document(children, options) { return { type: types.document, children: children, - footnotes: options.footnotes || [] + footnotes: options.footnotes || new Footnotes({}) }; } @@ -71,6 +71,14 @@ function FootnoteReference(options) { }; } +function Footnotes(footnotes) { + this._footnotes = footnotes; +} + +Footnotes.prototype.findFootnoteById = function(id) { + return this._footnotes[id] || null; +} + function Footnote(options) { return { type: types.footnote, @@ -105,5 +113,6 @@ exports.Text = Text; exports.Tab = Tab; exports.Hyperlink = Hyperlink; exports.FootnoteReference = FootnoteReference; +exports.Footnotes = Footnotes; exports.Footnote = Footnote; exports.Image = Image; |
