From c441efd704b841e959815892d7d2e2dc96f374cc Mon Sep 17 00:00:00 2001 From: Anna Date: Tue, 7 Jan 2025 10:03:44 -0500 Subject: [PATCH] fix(curriculum): allow class and id to be in any order step 24 todo list (#57644) Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com> Co-authored-by: Dario-DC <105294544+Dario-DC@users.noreply.github.com> --- .../64ec9343769e8f85c1e17e05.md | 8 ++++++-- .../workshop-todo-app/64ec9343769e8f85c1e17e05.md | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md index 55da519da92..8d308c35263 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-localstorage-by-building-a-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed-- diff --git a/curriculum/challenges/english/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md b/curriculum/challenges/english/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md index 55da519da92..8d308c35263 100644 --- a/curriculum/challenges/english/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md +++ b/curriculum/challenges/english/25-front-end-development/workshop-todo-app/64ec9343769e8f85c1e17e05.md @@ -14,13 +14,17 @@ Create a `div` element with the class of `task`. Utilize template strings to set You should create a `div` element with the class `task`. ```js -assert.match(code, /.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+class\s*=\s*('|")task\1(\s|$)/); ``` Your `div` element should have the `id` `${id}`. ```js -assert.match(code, /\s*<\/div>/) +const splitted = code.split(/tasksContainer\s*\.\s*innerHTML\s*\+=\s*`/)[1] +const matched = __helpers.removeJSComments(splitted).match(/.*?)>\s*<\/\s*div\s*>/); +assert.match(matched?.groups.attributes, /\s+id\s*=\s*('|")\$\{id\}\1(\s|$)/); ``` # --seed--