Skip to content

Commit

Permalink
Allow extra space before steal-remove-start and -end tags to support …
Browse files Browse the repository at this point in the history
…standard linting. #727
  • Loading branch information
ilyavf committed Jun 12, 2017
1 parent 97471da commit a561b88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/build/clean.js
Expand Up @@ -7,7 +7,7 @@ module.exports = function(original, options) {
}

removeTags.forEach(function(tag) {
result = result.replace(new RegExp('(\\s?)\/\/!' + tag + '-start((.|\n)*?)\/\/!' + tag + '-end', 'gim'), '');
result = result.replace(new RegExp('(\\s?)\/\/!(\\s?)' + tag + '-start((.|\n)*?)\/\/!(\\s?)' + tag + '-end', 'gim'), '');
});

return result;
Expand Down
15 changes: 15 additions & 0 deletions lib/build/clean_test.js
@@ -0,0 +1,15 @@
var assert = require("assert");
var clean = require("./clean");

describe("cleanAddress", function() {
var source = "123\n//!steal-remove-start\n456\n//!steal-remove-end\n789";
var source2 = "123\n//! steal-remove-start\n456\n//! steal-remove-end\n789";

it("removes blocks surrounded with steal-remove-start and -end", function() {
assert.equal(clean(source, {}), "123\n789");
});

it("allows an extra space before steal-remove-start for standard linting", function() {
assert.equal(clean(source2, {}), "123\n789");
});
});

0 comments on commit a561b88

Please sign in to comment.