aboutsummaryrefslogtreecommitdiff
path: root/lib/document-to-html.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-07 22:32:35 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-07 22:32:35 +0100
commitade35ac659f20fc27bb4c87d8511789cc7d05c07 (patch)
treef378dac985b75161f5a3c81a4e28aa59c5b48c43 /lib/document-to-html.js
parent30d04c156a26f40cb7f4cf72d66c3f29bb87ff60 (diff)
Handle comments without initials
Diffstat (limited to 'lib/document-to-html.js')
-rw-r--r--lib/document-to-html.js6
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 || "";
+};