html-differ icon indicating copy to clipboard operation
html-differ copied to clipboard

Added option ignoreEmptyAttributes: ignores attributes with empty values

Open dtom90 opened this issue 6 years ago • 0 comments

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>

dtom90 avatar May 30 '19 20:05 dtom90