diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-01-19 23:05:45 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-01-19 23:05:45 +0000 |
| commit | 965bd9513da033b9804af8ec29c7fa609a84512c (patch) | |
| tree | 28027622b24a00bb44fd4a1e9c91462493d78989 /lib/documents.js | |
| parent | 58cae6030e51481ffb462e52ab6aeb479e0a705d (diff) | |
Add support for endnotes
Diffstat (limited to 'lib/documents.js')
| -rw-r--r-- | lib/documents.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/documents.js b/lib/documents.js index aea2b39..5ec8aaf 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -7,7 +7,7 @@ var types = { text: "text", tab: "tab", hyperlink: "hyperlink", - footnoteReference: "footnoteReference", + noteReference: "noteReference", image: "image", note: "note", table: "table", @@ -78,10 +78,11 @@ function Hyperlink(children, options) { }; } -function FootnoteReference(options) { +function NoteReference(options) { return { - type: types.footnoteReference, - footnoteId: options.footnoteId + type: types.noteReference, + noteType: options.noteType, + noteId: options.noteId }; } @@ -91,8 +92,8 @@ function Notes(notes) { }); } -Notes.prototype.findFootnoteById = function(id) { - return this.findNoteByKey(noteKey("footnote", id)); +Notes.prototype.resolve = function(reference) { + return this.findNoteByKey(noteKey(reference.noteType, reference.noteId)); }; Notes.prototype.findNoteByKey = function(key) { @@ -154,7 +155,7 @@ exports.Run = Run; exports.Text = Text; exports.Tab = Tab; exports.Hyperlink = Hyperlink; -exports.FootnoteReference = FootnoteReference; +exports.NoteReference = NoteReference; exports.Notes = Notes; exports.Note = Note; exports.Image = Image; |
