diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-07-07 22:32:35 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-07-07 22:32:35 +0100 |
| commit | ade35ac659f20fc27bb4c87d8511789cc7d05c07 (patch) | |
| tree | f378dac985b75161f5a3c81a4e28aa59c5b48c43 /lib/document-to-html.js | |
| parent | 30d04c156a26f40cb7f4cf72d66c3f29bb87ff60 (diff) | |
Handle comments without initials
Diffstat (limited to 'lib/document-to-html.js')
| -rw-r--r-- | lib/document-to-html.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/document-to-html.js b/lib/document-to-html.js index eb7c8e1..bc61e34 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -247,7 +247,7 @@ function DocumentConversion(options, comments) { return findHtmlPath(reference, htmlPaths.ignore).wrap(function() { var comment = comments[reference.commentId]; var count = referencedComments.length + 1; - var label = "[" + comment.authorInitials + count + "]"; + var label = "[" + commentAuthorLabel(comment) + count + "]"; referencedComments.push({label: label, comment: comment}); // TODO: remove duplication with note references return [ @@ -393,3 +393,7 @@ function walkHtml(nodes, callback) { } }); } + +var commentAuthorLabel = exports.commentAuthorLabel = function commentAuthorLabel(comment) { + return comment.authorInitials || ""; +}; |
