bem / html-differ

Сompares two HTML
http://bem.info/tools/testing/html-differ/
MIT License
212 stars 45 forks source link

Added option ignoreEmptyAttributes: ignores attributes with empty values #159

Open dtom90 opened 5 years ago

dtom90 commented 5 years ago
ignoreEmptyAttributes: Boolean

Makes html-differ ignore tags' attributes with empty values during the comparison.
From the list of the same tag's attributes, the attributes which have empty values will be ignored (default: false).

Example: true
For example, the following two code samples will be considered to be equivalent:

<div style=""></div>
<div></div>

This option can also be used to completely ignore attributes specified by the ignoreAttributes option, even if they are present in one example, but not in the other.

Example: ignoreAttributes: ['id', 'for'], ignoreEmptyAttributes: true
For example, the following two code samples will be considered to be equivalent:

<label for="random">label for input</label>
<input id="random">
<label>label for input</label>
<input>