Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Block.prototype.compile = function (tasks) {
var buildResult = this.build();

if (this.config.keepBlockTags) {
buildResult.unshift(this.beginTag);
buildResult.push(this.endTag);
buildResult.unshift(this.indent + this.beginTag);
buildResult.push(this.indent + this.endTag);
}

buildResult.unshift(null);
Expand Down
8 changes: 8 additions & 0 deletions test/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ describe('Buffer mode', function () {
var stream = plugin({lorem: 'ipsum'});
compare(new Buffer(fixture), expected, stream, done);
});

it('Should keep indentation', function (done) {
var fixture = '<html>\n <!-- build:js -->\n Some text\n <!-- endbuild -->\n</html>';
var expected = '<html>\n <!-- build:js -->\n <!-- endbuild -->\n</html>';

var stream = plugin({}, {keepBlockTags: true});
compare(new Buffer(fixture), expected, stream, done);
});
});

describe('resolvePaths', function () {
Expand Down
8 changes: 8 additions & 0 deletions test/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ describe('Stream mode', function () {
var stream = plugin({lorem: 'ipsum'});
compare(stringToStream(fixture), expected, stream, done);
});

it('Should keep indentation', function (done) {
var fixture = '<html>\n <!-- build:js -->\n Some text\n <!-- endbuild -->\n</html>';
var expected = '<html>\n <!-- build:js -->\n <!-- endbuild -->\n</html>';

var stream = plugin({}, {keepBlockTags: true});
compare(stringToStream(fixture), expected, stream, done);
});
});

describe('resolvePaths', function () {
Expand Down