fix(curriculum): em dash adjusting (#63901)

This commit is contained in:
Gary Yeung
2025-11-25 19:08:39 +05:00
committed by GitHub
parent 685ab392cf
commit c3dcec1ac7
11 changed files with 33 additions and 27 deletions
@@ -7,7 +7,9 @@ dashedName: step-9
# --description--
Below the block quotation element, add a paragraph element with the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
Below the block quotation element, add a paragraph element with the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
`—` is an HTML entity that represents an em dash `—`.
# --hints--
@@ -17,11 +19,15 @@ You should have a `p` element below the `blockquote` element.
assert.exists(document.querySelector('section:first-of-type > blockquote + p'));
```
Your `p` element should have the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
Your `p` element should have the text `—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]`.
```js
const pEl = document.querySelector('section:first-of-type > blockquote + p');
assert.equal(pEl?.innerText.trim(), '—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]');
const html = pEl?.innerHTML.trim();
assert.oneOf(html, [
'—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]',
'—Quincy Larson, How to Learn to Code and Get a Developer Job [Full Book]'
]);
```
# --seed--
@@ -54,11 +54,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
--fcc-editable-region--
@@ -68,11 +68,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
@@ -86,11 +86,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
const upperCaseInput = cleanedInput.toUpperCase();
@@ -54,11 +54,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
const upperCaseInput = cleanedInput.toUpperCase();
@@ -52,7 +52,7 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
--fcc-editable-region--
@@ -9,7 +9,7 @@ dashedName: step-7
Now it is time to see the results of trimming whitespace at the beginning of the string.
Below your `trimmedStart` variable, add a `console.log()` with the string `"After using the trimStart() method — leading spaces removed:"`.
Below your `trimmedStart` variable, add a `console.log()` with the string `"After using the trimStart() method, leading spaces removed:"`.
Then below that `console.log()`, add another `console.log()` with the `trimmedStart` variable.
@@ -22,10 +22,10 @@ const getLogs = () => spy.calls.map(call => call?.[0]);
# --hints--
You should log the string `"After using the trimStart() method — leading spaces removed:"` to the console.
You should log the string `"After using the trimStart() method, leading spaces removed:"` to the console.
```js
assert.equal(getLogs()[4], "After using the trimStart() method — leading spaces removed:");
assert.equal(getLogs()[4], "After using the trimStart() method, leading spaces removed:");
```
You should log the `trimmedStart` variable to the console.
@@ -9,7 +9,7 @@ dashedName: step-9
Now it is time to see the results of trimming whitespace at the end of the string.
Below your `trimmedEnd` variable, add a `console.log()` with the string `"After using the trimEnd() method — trailing spaces removed:"`.
Below your `trimmedEnd` variable, add a `console.log()` with the string `"After using the trimEnd() method, trailing spaces removed:"`.
Then below that `console.log()`, add another `console.log()` with the `trimmedEnd` variable.
@@ -22,10 +22,10 @@ const getLogs = () => spy.calls.map(call => call?.[0]);
# --hints--
You should log the string `"After using the trimEnd() method — trailing spaces removed:"` to the console.
You should log the string `"After using the trimEnd() method, trailing spaces removed:"` to the console.
```js
assert.equal(getLogs()[6], "After using the trimEnd() method — trailing spaces removed:");
assert.equal(getLogs()[6], "After using the trimEnd() method, trailing spaces removed:");
```
You should log the `trimmedEnd` variable to the console.
@@ -48,7 +48,7 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
--fcc-editable-region--
@@ -48,11 +48,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
--fcc-editable-region--
@@ -51,11 +51,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
const upperCaseInput = cleanedInput.toUpperCase();
@@ -50,11 +50,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
const upperCaseInput = cleanedInput.toUpperCase();
@@ -85,11 +85,11 @@ console.log("Result of trimming whitespace from both ends:");
console.log(cleanedInput);
const trimmedStart = userInput.trimStart();
console.log("After using the trimStart() method — leading spaces removed:");
console.log("After using the trimStart() method, leading spaces removed:");
console.log(trimmedStart);
const trimmedEnd = userInput.trimEnd();
console.log("After using the trimEnd() method — trailing spaces removed:");
console.log("After using the trimEnd() method, trailing spaces removed:");
console.log(trimmedEnd);
const upperCaseInput = cleanedInput.toUpperCase();