MarkTraceur has submitted this change and it was merged.
Change subject: Handle 1 comment too
......................................................................
Handle 1 comment too
Great job Mark
Change-Id: Ibba3b1cf46013b45dadd441e0b19a368c8d746bb
---
M src/preprocess.js
M src/template.txt
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
MarkTraceur: Verified; Looks good to me, approved
diff --git a/src/preprocess.js b/src/preprocess.js
index e4cd642..d7f5ec4 100644
--- a/src/preprocess.js
+++ b/src/preprocess.js
@@ -60,12 +60,12 @@
url: message.change.url,
owner: message.change.owner.name
};
- var inlineCount = message.comment.match(/(?:^|\s)\((\d+)
comments\)(?:$|\s)/),
+ var inlineCount = message.comment.match(/(?:^|\s)\((\d+)
comments?\)(?:$|\s)/),
comment = message.comment
// Strip out useless first line
.replace(/^\s*Patch Set \d+:.*$/m, '')
// Strip out count of inline comments
- .replace(/^\s*\(\d+ comments\)$/m, '')
+ .replace(/^\s*\(\d+ comments?\)$/m, '')
.trim().split("\n")[0].trim();
if(!comment) {
comment = message.change.subject.substring(0, 140);
diff --git a/src/template.txt b/src/template.txt
index c905019..7cb592e 100644
--- a/src/template.txt
+++ b/src/template.txt
@@ -14,7 +14,7 @@
{% endif %}
{{message}}
{% if inlineComments -%}
- ({{inlineComments|color('bold.green')}} comments)
+ ({{inlineComments|color('bold.green')}} comment{% if inlineComments >
1 %}s{% endif %})
{% endif %}
[{{repo}}]
{% if branch %} ({{branch}}) {% endif %}
--
To view, visit https://gerrit.wikimedia.org/r/95691
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibba3b1cf46013b45dadd441e0b19a368c8d746bb
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/grrrit
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits