From dd3196da1b592b70d3f7dbddb880452057d2ea79 Mon Sep 17 00:00:00 2001 From: Egil Hansen Date: Thu, 27 Jan 2022 08:59:29 +0000 Subject: [PATCH] docs: add diff:ignoreChildren and diff:ignoreAttributes description --- .../verification/semantic-html-comparison.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/site/docs/verification/semantic-html-comparison.md b/docs/site/docs/verification/semantic-html-comparison.md index 98d1908e3..4f0fdb1fb 100644 --- a/docs/site/docs/verification/semantic-html-comparison.md +++ b/docs/site/docs/verification/semantic-html-comparison.md @@ -46,6 +46,29 @@ Here are the customization options you have available to you: ``` +- **Ignore children:** Use the `diff:ignoreChildren` attribute (no value is needed) to ignore all child nodes/elements of an element. This does not include attributes. For example, to ignore all child nodes of the `h1` element, do the following: + + ```html +
+

Hello world

+
+ ``` + +- **Ignore all attributes:** Use the `diff:ignoreAttributes` attribute (no value is needed) to ignore all attributes of an element. For example: + + ```html +
+

Hello world

+
+ ``` + + > [!NOTE] + > The `diff:ignoreChildren` and `diff:ignoreAttributes` attributes can be combined to ignore all child nodes/element *and* attributes of an element, but still verify that the element itself exists. For example: + ```html +
+

Hello world

+
+ - **Configure whitespace handling:** By default, all nodes and elements are compared using the `Normalize` whitespace handling option. The `Normalize` option will trim all text nodes and replace two or more whitespace characters with a single space character. The other options are `Preserve`, which will leave all whitespace unchanged, and `RemoveWhitespaceNodes`, which will only remove empty text nodes. To override the default option, use the `diff:whitespace` attribute, and pass one of the three options to it. For example: