From 1abee24a34dfb6968092bb75b920c37b2199f2c7 Mon Sep 17 00:00:00 2001 From: deepsweet Date: Sun, 18 Nov 2012 18:17:46 +0200 Subject: [PATCH] plugins/removeComments: ignore comments which starts with 'git st' (close (#43) --- plugins/removeComments.js | 4 +++- test/plugins/removeComments.02.orig.svg | 4 ++++ test/plugins/removeComments.02.should.svg | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/plugins/removeComments.02.orig.svg create mode 100644 test/plugins/removeComments.02.should.svg diff --git a/plugins/removeComments.js b/plugins/removeComments.js index e46eea8e..55c38589 100644 --- a/plugins/removeComments.js +++ b/plugins/removeComments.js @@ -13,6 +13,8 @@ */ exports.removeComments = function(item, params) { - return !item.comment; + if (item.comment && item.comment.charAt(0) !== '!') { + return false; + } }; diff --git a/test/plugins/removeComments.02.orig.svg b/test/plugins/removeComments.02.orig.svg new file mode 100644 index 00000000..9b16fa67 --- /dev/null +++ b/test/plugins/removeComments.02.orig.svg @@ -0,0 +1,4 @@ + + + test + diff --git a/test/plugins/removeComments.02.should.svg b/test/plugins/removeComments.02.should.svg new file mode 100644 index 00000000..9b16fa67 --- /dev/null +++ b/test/plugins/removeComments.02.should.svg @@ -0,0 +1,4 @@ + + + test +