mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): fix broken HTML in Calorie Counter (#57170)
This commit is contained in:
+15
-3
@@ -27,7 +27,7 @@ Your `input` element should have a `type` attribute set to `text`.
|
||||
|
||||
```js
|
||||
const HTMLstring = code.split(/HTMLString\s*=/)[1];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
|
||||
assert.match(inputAttributes, /type\s*=\s*"text"/);
|
||||
```
|
||||
|
||||
@@ -35,7 +35,7 @@ Your `input` element should have a `placeholder` attribute set to `Name`.
|
||||
|
||||
```js
|
||||
const HTMLstring = code.split(/HTMLString\s*=/)[1];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
|
||||
assert.match(inputAttributes, /placeholder\s*=\s*"Name"/);
|
||||
```
|
||||
|
||||
@@ -43,10 +43,22 @@ Your `input` element should have an `id` attribute set to `${entryDropdown.value
|
||||
|
||||
```js
|
||||
const HTMLstring = code.split(/HTMLString\s*=/)[1];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*?>/)[0];
|
||||
const inputAttributes = HTMLstring.match(/<input\s+.*/)[0];
|
||||
assert.match(inputAttributes, /id\s*=\s*"\${entryDropdown.value}-\${entryNumber}-name"/);
|
||||
```
|
||||
|
||||
You should not have a closing `input` tag in your code.
|
||||
|
||||
```js
|
||||
assert.notMatch(code, /<\/input>/);
|
||||
```
|
||||
|
||||
The `input` element should have the closing `>`.
|
||||
|
||||
```js
|
||||
assert.match(code, /HTMLString\s*=\s*`\n\s*<label\s+for\s*=\s*"\$\{entryDropdown\.value\}-\$\{entryNumber\}-name"\s*>Entry\s\$\{entryNumber\}\sName<\/label>\n\s*<input\s+[^>]*>/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user