Skip to content

Commit 2ed1a11

Browse files
committed
Merge pull request #101 from bem/ignoreEndTags
Rename option 'ignoreClosingTags' to 'ignoreEndTags'
2 parents 2b62811 + daf52d5 commit 2ed1a11

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/HtmlDiff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var diff = require('diff'),
1010
* @param {String[]} [options.compareAttributesAsJSON]
1111
* @param {Boolean} [options.ignoreWhitespaces=true]
1212
* @param {Boolean} [options.ignoreComments]
13-
* @param {Boolean} [options.ignoreClosingTags=false]
13+
* @param {Boolean} [options.ignoreEndTags=false]
1414
* @param {Boolean} [options.ignoreDuplicateAttributes=false]
1515
*/
1616
HtmlDiff = function (options) {

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ HtmlDiff.prototype.tokenize = function (html) {
2222
* @param {String[]} [options.compareAttributesAsJSON]
2323
* @param {Boolean} [options.ignoreWhitespaces=true]
2424
* @param {Boolean} [options.ignoreComments=true]
25-
* @param {Boolean} [options.ignoreClosingTags=false]
25+
* @param {Boolean} [options.ignoreEndTags=false]
2626
* @param {Boolean} [options.ignoreDuplicateAttributes=false]
2727
*/
2828
var HtmlDiffer = function (options) {

lib/utils/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var _ = require('lodash');
3131
ignoreWhitespaces: true,
3232
ignoreComments: true,
3333

34-
ignoreClosingTags: false,
34+
ignoreEndTags: false,
3535
ignoreDuplicateAttributes: false
3636
});
3737
};

lib/utils/modify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var SimpleApiParser = require('parse5').SimpleApiParser,
1010
* @param {String[]} [options.compareAttributesAsJSON]
1111
* @param {Boolean} [options.ignoreWhitespaces=true]
1212
* @param {Boolean} [options.ignoreComments=true]
13-
* @param {Boolean} [options.ignoreClosingTags=false]
13+
* @param {Boolean} [options.ignoreEndTags=false]
1414
* @param {Boolean} [options.ignoreDuplicateAttributes=false]
1515
* returns {String}
1616
*/
@@ -48,7 +48,7 @@ module.exports = function (value, options) {
4848
* @param {String} tagName
4949
*/
5050
endTag: function (tagName) {
51-
!options.ignoreClosingTags && (modifiedValue += serialize.endTag(tagName));
51+
!options.ignoreEndTags && (modifiedValue += serialize.endTag(tagName));
5252
},
5353
/**
5454
* @param {String} text
File renamed without changes.
File renamed without changes.

test/diff/isEqual.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ describe('\'isEqual\'', function () {
8181
htmlDiffer.isEqual(files.html1, files.html2).must.be.true();
8282
});
8383

84-
it('must work option \'ignoreClosingTags\'', function () {
85-
var htmlDiffer = new HtmlDiffer({ ignoreClosingTags: true }),
86-
files = readFiles('ignore-closing-tags');
84+
it('must work option \'ignoreEndTags\'', function () {
85+
var htmlDiffer = new HtmlDiffer({ ignoreEndTags: true }),
86+
files = readFiles('ignore-end-tags');
8787

8888
htmlDiffer.isEqual(files.html1, files.html2).must.be.true();
8989
});

0 commit comments

Comments
 (0)