mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix: allow spaces around text content of elements in workshop blog page (#62261)
This commit is contained in:
@@ -92,7 +92,7 @@ Your `figcaption` element should have a the text of `Mr. Whiskers in the Garden`
|
||||
|
||||
```js
|
||||
const figcaptionElement = document.querySelector('figcaption');
|
||||
assert.strictEqual(figcaptionElement?.innerText, "Mr. Whiskers in the Garden")
|
||||
assert.strictEqual(figcaptionElement?.innerText.trim(), "Mr. Whiskers in the Garden")
|
||||
```
|
||||
|
||||
Your `figcaption` should be below the `img` element. You have them in the wrong order.
|
||||
|
||||
@@ -39,7 +39,7 @@ Your first paragraph element should have lorem ipsum text. Double check for spel
|
||||
const paragraphElement = document.querySelector('article p:first-of-type');
|
||||
const loremIpsum = `Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae quidem voluptatum quas. Quisquam quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.`
|
||||
|
||||
assert.strictEqual(paragraphElement?.innerText, loremIpsum);
|
||||
assert.strictEqual(paragraphElement?.innerText.trim().replaceAll(/\s+/g, ' '), loremIpsum);
|
||||
```
|
||||
|
||||
Your second paragraph element should have lorem ipsum text. Double check for spelling and punctuation errors.
|
||||
@@ -48,7 +48,7 @@ Your second paragraph element should have lorem ipsum text. Double check for spe
|
||||
const paragraphElement = document.querySelector('article p:last-of-type');
|
||||
const loremIpsum = `Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae quidem voluptatum quas. Quisquam quod, voluptates, quae, quos quibusdam dolorum quia nemo repudiandae quidem voluptatum quas.`
|
||||
|
||||
assert.strictEqual(paragraphElement?.innerText, loremIpsum);
|
||||
assert.strictEqual(paragraphElement?.innerText.trim().replaceAll(/\s+/g, ' '), loremIpsum);
|
||||
```
|
||||
|
||||
Your paragraphs should come after the `h3` element.
|
||||
|
||||
@@ -18,7 +18,7 @@ Your first paragraph should have the text of `Hi there! I'm Jane Doe, a passiona
|
||||
```js
|
||||
const pElement = document.querySelector('body p:first-of-type');
|
||||
const text = "Hi there! I'm Jane Doe, a passionate writer who finds endless inspiration in the antics of my beloved cat, Mr. Whiskers."
|
||||
assert.strictEqual(pElement?.innerText, text);
|
||||
assert.strictEqual(pElement?.innerText.trim(), text);
|
||||
```
|
||||
|
||||
Your first paragraph should be nested inside the `section` element.
|
||||
@@ -40,7 +40,7 @@ Your second paragraph should have the text of `His playful nature and boundless
|
||||
```js
|
||||
const pElement = document.querySelector('#about p:last-of-type');
|
||||
const text = "His playful nature and boundless energy keeps me on my toes. I love him so much."
|
||||
assert.strictEqual(pElement?.innerText, text);
|
||||
assert.strictEqual(pElement?.innerText.trim(), text);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
@@ -25,7 +25,7 @@ You should wrap the text `555-555-5555` in an `a` element.
|
||||
const firstPElement = document.querySelector('footer #contact address p:nth-of-type(1)');
|
||||
const link = firstPElement.querySelector('a');
|
||||
assert.exists(link);
|
||||
assert.strictEqual(link.textContent, "555-555-5555");
|
||||
assert.strictEqual(link.textContent.trim(), "555-555-5555");
|
||||
```
|
||||
|
||||
Your `a` element should have an `href` attribute.
|
||||
|
||||
@@ -27,7 +27,7 @@ You should wrap the text `fake@email.com` in an `a` element.
|
||||
const secondPElement = document.querySelector('footer #contact address p:nth-of-type(2)');
|
||||
const link = secondPElement.querySelector('a');
|
||||
assert.exists(link);
|
||||
assert.strictEqual(link.textContent, "fake@email.com");
|
||||
assert.strictEqual(link.textContent.trim(), "fake@email.com");
|
||||
```
|
||||
|
||||
Your `a` element should have an `href` attribute.
|
||||
|
||||
Reference in New Issue
Block a user