From 0fcff887fe5a6e682da9ccd47a4e6c5927f332ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Livet?= Date: Fri, 17 Mar 2017 11:29:27 +0100 Subject: [PATCH] Avoid putting a space in empty comments In our pipeline, empty comments in po files are generated without a space after '#' and saving a po file using pofile lib generates unwanted diff that need to be handle manually which is really annoying. This pull request simply trim the comment line. --- lib/po.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/po.js b/lib/po.js index 623165f..a7f9c2c 100644 --- a/lib/po.js +++ b/lib/po.js @@ -20,12 +20,12 @@ PO.prototype.toString = function () { if (this.comments) { this.comments.forEach(function (comment) { - lines.push('# ' + comment); + lines.push(('# ' + comment).trim()); }); } if (this.extractedComments) { this.extractedComments.forEach(function (comment) { - lines.push('#. ' + comment); + lines.push(('#. ' + comment).trim()); }); }