Skip to content

Commit c441efd

Browse files
a2937majestic-owl448Dario-DC
authored
fix(curriculum): allow class and id to be in any order step 24 todo list (freeCodeCamp#57644)
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com>
1 parent e7897de commit c441efd

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set
1414
You should create a `div` element with the class `task`.
1515

1616
```js
17-
assert.match(code, /<div\s+class\s*=\s*('|")task\1/)
17+
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
18+
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
19+
assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/);
1820
```
1921
2022
Your `div` element should have the `id` `${id}`.
2123
2224
```js
23-
assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/)
25+
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
26+
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
27+
assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/);
2428
```
2529
2630
# --seed--

curriculum/challenges/english/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set
1414
You should create a `div` element with the class `task`.
1515

1616
```js
17-
assert.match(code, /<div\s+class\s*=\s*('|")task\1/)
17+
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
18+
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
19+
assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/);
1820
```
1921
2022
Your `div` element should have the `id` `${id}`.
2123
2224
```js
23-
assert.match(code, /<div\s+class\s*=\s*('|")task\1\s*id\s*=\s*('|")\$\{id\}\2\s*>\s*<\/div>/)
25+
const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1]
26+
const matched = __helpers.removeJSComments(splitted).match(/<div(?<attributes>.*?)>\s*<\/\s*div\s*>/);
27+
assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/);
2428
```
2529
2630
# --seed--

0 commit comments

Comments
 (0)