You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -297,7 +298,7 @@ By using the inline attribute `diff:regex` on the element containing the text no
297
298
The above control text would use case-insensitive regular expression to match against a test text string (e.g. "HELLO WORLD 2020").
298
299
299
300
#### Style sheet text comparer
300
-
Different rules whitespace apply to style sheets (style information) inside `<style>` tags and `style="..."` attributes, than to HTML5. This comparer will parse the style information inside `<style>` tags and `style="..."` attributes and compare the result of the parsing, instead doing a direct string comparison. This should remove false-positives where e.g. insignificant whitespace makes two otherwise equal set of style informations result in a diff.
301
+
Different whitespace rules apply to style sheets (style information) inside `<style>` tags, than to HTML5. This comparer will parse the style information inside `<style>` tags and compare the result of the parsing, instead doing a direct string comparison. This should remove false-positives where e.g. insignificant whitespace makes two otherwise equal set of style informations result in a diff.
301
302
302
303
To add this comparer, use the `WithStyleSheetComparer()` method on the `DiffBuilder` class, e.g.:
303
304
@@ -382,7 +383,20 @@ var diffs = DiffBuilder
382
383
.Build();
383
384
```
384
385
385
-
### Ignore attributes during diffing
386
+
#### Style attribute comparer
387
+
Different whitespace rules apply to style information inside `style="..."` attributes, than to HTML5. This comparer will parse the style information inside `style="..."` attributes and compare the result of the parsing, instead doing a direct string comparison. This should remove false-positives where e.g. insignificant whitespace makes two otherwise equal set of style informations result in a diff.
388
+
389
+
To add this comparer, use the `WithStyleAttributeComparer()` method on the `DiffBuilder` class, e.g.:
390
+
391
+
```csharp
392
+
vardiffs=DiffBuilder
393
+
.Compare(controlHtml)
394
+
.WithTest(testHtml)
395
+
.WithStyleAttributeComparer()
396
+
.Build();
397
+
```
398
+
399
+
#### Ignore attributes during diffing
386
400
To ignore a specific attribute during comparison, add the `:ignore` postfix to the attribute on the control element. Thus will simply skip comparing the two attributes and not report any differences between them. E.g. to ignore the `class` attribute, do:
0 commit comments