From ade35ac659f20fc27bb4c87d8511789cc7d05c07 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 7 Jul 2016 22:32:35 +0100 Subject: Handle comments without initials --- lib/document-to-html.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') 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 || ""; +}; -- cgit v1.2.3