fix(curriculum): clarify requirements for id property (#57335)

This commit is contained in:
Lasse Jørgensen
2024-11-26 21:59:04 +01:00
committed by GitHub
parent 155c1b0280
commit 8ca50440e4

View File

@@ -7,7 +7,7 @@ dashedName: step-68
# --description--
Finally, it is time to call the `removeSpecialChars` on the `id`, `title`, and `description` properties in your `taskObj`.
Call `removeSpecialChars` on the `title`, and `description` properties in your `taskObj`. For the `id` property, only call it on the `titleInput.value` part of the property value.
This will remove issues with broken task data.
@@ -15,22 +15,22 @@ With that you have completed the project.
# --hints--
You should call `removeSpecialChars` on `titleInput.value` when assigning the `id`.
You should call `removeSpecialChars` on `titleInput.value` when assigning the `id`.
```js
assert.match(code, /\s*id:\s*`\$\{removeSpecialChars\(titleInput\.value\)\.toLowerCase\(\s*\)\.split\(\s*('|")\s{1}\1\s*\)\.join\(\s*('|")-\2\s*\)\}-\$\{Date\.now\(\s*\)\}`\s*/)
assert.match(code, /\s*id:\s*`\$\{removeSpecialChars\(titleInput\.value\)\.toLowerCase\(\s*\)\.split\(\s*('|")\s{1}\1\s*\)\.join\(\s*('|")-\2\s*\)\}-\$\{Date\.now\(\s*\)\}`\s*/);
```
You should call `removeSpecialChars` on `titleInput.value` when assigning the `title`.
You should call `removeSpecialChars` on `titleInput.value` when assigning the `title`.
```js
assert.match(code, /\s*title:\s*removeSpecialChars\(titleInput\.value\)\s*/,)
assert.match(code, /\s*title:\s*removeSpecialChars\(titleInput\.value\)\s*/);
```
You should call `removeSpecialChars` on `descriptionInput.value` when assigning the `description`.
You should call `removeSpecialChars` on `descriptionInput.value` when assigning the `description`.
```js
assert.match(code, /\s*description:\s*removeSpecialChars\(descriptionInput\.value\)\s*/)
assert.match(code, /\s*description:\s*removeSpecialChars\(descriptionInput\.value\)\s*/);
```
# --seed--