From 130e330121f19eeb18b351f285bf19ea4e89bb5e Mon Sep 17 00:00:00 2001 From: a2937 Date: Wed, 20 Dec 2023 03:39:35 -0500 Subject: [PATCH] fix(curriculum): warn user about spaces in registration form step 31 (#52044) Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- .../60fab8367d35de04e5cb7929.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fab8367d35de04e5cb7929.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fab8367d35de04e5cb7929.md index 493d7d99bc3..8d0c3bf7b9f 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fab8367d35de04e5cb7929.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-forms-by-building-a-registration-form/60fab8367d35de04e5cb7929.md @@ -42,7 +42,15 @@ assert.match(document.querySelector('fieldset:nth-child(3) + label > input + a') You should only wrap the `a` element around the text `terms and conditions`. ```js -assert.equal(document.querySelector('fieldset:nth-child(3) + label > input + a')?.textContent, 'terms and conditions'); +assert.equal(document.querySelector('fieldset:nth-child(3) + label > input + a')?.textContent.trim(), 'terms and conditions'); +``` + +The text inside your anchor element has extra leading or trailing whitespace. The only spaces in the anchor text should be between the words `terms`, `and`, and `conditions`. + +```js +const nestedAnchor = document.querySelector('fieldset:nth-child(3) + label > input + a')?.textContent; +const innerContent = nestedAnchor.innerHTML; +assert.isNotTrue(/^\s+|\s+$/.test(innerContent)); ``` # --seed--