From 30d04c156a26f40cb7f4cf72d66c3f29bb87ff60 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 7 Jul 2016 22:27:20 +0100 Subject: Use overall comment count for comment numbering This matches the behaviour in Word more closely. --- lib/document-to-html.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/document-to-html.js b/lib/document-to-html.js index 1b3a3df..eb7c8e1 100644 --- a/lib/document-to-html.js +++ b/lib/document-to-html.js @@ -30,7 +30,6 @@ function DocumentConversion(options, comments) { var noteReferences = []; var referencedComments = []; - var commentCountByInitials = {}; options = _.extend({ignoreEmptyParagraphs: true}, options); var idPrefix = options.idPrefix === undefined ? "" : options.idPrefix; @@ -247,10 +246,7 @@ function DocumentConversion(options, comments) { function convertCommentReference(reference, messages) { return findHtmlPath(reference, htmlPaths.ignore).wrap(function() { var comment = comments[reference.commentId]; - if (commentCountByInitials[comment.authorInitials] === undefined) { - commentCountByInitials[comment.authorInitials] = 0; - } - var count = ++commentCountByInitials[comment.authorInitials]; + var count = referencedComments.length + 1; var label = "[" + comment.authorInitials + count + "]"; referencedComments.push({label: label, comment: comment}); // TODO: remove duplication with note references -- cgit v1.2.3