From d3525ce975ffed81ecd381b57076b2bd95e4e0bc Mon Sep 17 00:00:00 2001 From: Krzysztof G <60067306+gikf@users.noreply.github.com> Date: Sun, 7 Jan 2024 05:42:27 +0100 Subject: [PATCH] fix(curriculum): allow optional spaces (#53002) --- .../63c2164c0df38a382062c4af.md | 6 ++--- .../63c21774193de43bbc6a769f.md | 4 ++-- .../63c217ccd939053ce4fa16d6.md | 16 ++++++------- .../63c21839f56eaf3ef4e027c4.md | 12 +++++----- .../63c2187f55eb0f400269568f.md | 24 +++++++++---------- .../63c2194dce265f429300c8b1.md | 2 +- .../63e95a45dce95baf41dd4f78.md | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c2164c0df38a382062c4af.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c2164c0df38a382062c4af.md index 49d628f93f2..659491a0a6d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c2164c0df38a382062c4af.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c2164c0df38a382062c4af.md @@ -18,19 +18,19 @@ This will return a `NodeList` of all the text inputs in the form. You can then a You should pass the string `input[type="text"]` to the `querySelectorAll()` method. ```js -assert.match(addEntry.toString(), /entryNumber\s*=\s*targetInputContainer\.querySelectorAll\(\s*'input\[type="text"]'\)/) +assert.match(addEntry.toString(), /entryNumber\s*=\s*targetInputContainer\.querySelectorAll\(\s*'\s*input\s*\[\s*type\s*=\s*"text"\s*]\s*'\s*\)/) ``` You should access the `length` property of your `querySelectorAll()`. ```js -assert.match(addEntry.toString(), /\.querySelectorAll\(\s*'input\[type="text"]'\)\.length/) +assert.match(addEntry.toString(), /\.querySelectorAll\(\s*'\s*input\s*\[\s*type\s*=\s*"text"\s*]\s*'\)\.length/) ``` Your `entryNumber` variable should be the `length` of the `querySelectorAll`. ```js -assert.match(addEntry.toString(), /entryNumber\s*=\s*targetInputContainer\.querySelectorAll\(\s*'input\[type="text"]'\)\.length/) +assert.match(addEntry.toString(), /entryNumber\s*=\s*targetInputContainer\.querySelectorAll\(\s*'\s*input\s*\[\s*type\s*=\s*"text"\s*]\s*'\)\.length/) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21774193de43bbc6a769f.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21774193de43bbc6a769f.md index 815badb57cd..76aa140d876 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21774193de43bbc6a769f.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21774193de43bbc6a769f.md @@ -14,13 +14,13 @@ Give your `label` element a `for` attribute with the value `X-#-name`, where `X` Your `label` element should have a `for` attribute set to `${entryDropdown.value}-${entryNumber}-name`. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*/) +assert.match(code, /HTMLString\s*=\s*`\n\s*/) ``` Your `label` element should have the same text as before. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Entry\s\$\{entryNumber\}\sName<\/label>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Entry\s\$\{entryNumber\}\sName<\/label>/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c217ccd939053ce4fa16d6.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c217ccd939053ce4fa16d6.md index 10170c2f474..4a1ea0cf0f3 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c217ccd939053ce4fa16d6.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c217ccd939053ce4fa16d6.md @@ -14,37 +14,37 @@ After your `label` element, and on a new line in your template string, create an You should not modify your `label` element. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Entry\s\$\{entryNumber\}\sName<\/label>/); +assert.match(code, /HTMLString\s*=\s*`\n\s*Entry\s\$\{entryNumber\}\sName<\/label>/); ``` You should add an `input` element on a new line. ```js -assert.match(code, /HTMLString\s*=\s*`\n\s*Entry\s\$\{entryNumber\}\sName<\/label>\n\s*Entry\s\$\{entryNumber\}\sName<\/label>\n\s*/)[0]; -assert.include(inputAttributes, 'type="text"'); +assert.match(inputAttributes, /type\s*=\s*"text"/); ``` Your `input` element should have a `placeholder` attribute set to `Name`. ```js -const HTMLstring = code.split("HTMLString =")[1]; +const HTMLstring = code.split(/HTMLString\s*=/)[1]; const inputAttributes = HTMLstring.match(//)[0]; -assert.include(inputAttributes, 'placeholder="Name"'); +assert.match(inputAttributes, /placeholder\s*=\s*"Name"/); ``` Your `input` element should have an `id` attribute set to `${entryDropdown.value}-${entryNumber}-name`. ```js -const HTMLstring = code.split("HTMLString =")[1]; +const HTMLstring = code.split(/HTMLString\s*=/)[1]; const inputAttributes = HTMLstring.match(//)[0]; -assert.include(inputAttributes, 'id="${entryDropdown.value}-${entryNumber}-name"'); +assert.match(inputAttributes, /id\s*=\s*"\${entryDropdown.value}-\${entryNumber}-name"/); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21839f56eaf3ef4e027c4.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21839f56eaf3ef4e027c4.md index 25b3089d293..40bce1e0f8e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21839f56eaf3ef4e027c4.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-form-validation-by-building-a-calorie-counter/63c21839f56eaf3ef4e027c4.md @@ -14,21 +14,21 @@ Create another `label` element (on a new line) at the end of your `HTMLString`. You should have two `label` elements in your `HTMLString`. ```js -const HTMLstring = code.split("HTMLString =")[1]; +const HTMLstring = code.split(/HTMLString\s*=/)[1]; assert.equal(HTMLstring.match(/