Skip to content

Commit ae6357f

Browse files
fix(curriculum): add guidance and tests for lowercase HTML tags (freeCodeCamp#61875)
1 parent 428918f commit ae6357f

File tree

12 files changed

+81
-1
lines changed

12 files changed

+81
-1
lines changed

curriculum/challenges/english/blocks/cat-photo-app/5dc174fcf86c76b9248c6eb2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Your `h1` element should have an opening tag. Opening tags have this syntax: `<e
2626
assert.exists(document.querySelector('h1'));
2727
```
2828

29+
Your `h1` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
30+
31+
```js
32+
assert.notMatch(code, /<\/?H1>/);
33+
```
34+
2935
Your `h1` element should have a closing tag. Closing tags have this syntax: `</elementName>`.
3036

3137
```js

curriculum/challenges/english/blocks/cat-photo-app/5dc1798ff86c76b9248c6eb3.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Your `h1` element's text should be 'CatPhotoApp'. You have either omitted the te
3737
assert.equal(document.querySelector('h1')?.innerText.toLowerCase(), 'catphotoapp');
3838
```
3939
40+
Your `h2` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
41+
42+
```js
43+
assert.notMatch(code, /<\/?H2>/);
44+
```
45+
4046
Your `h2` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
4147
4248
```js

curriculum/challenges/english/blocks/cat-photo-app/5dc17d3bf86c76b9248c6eb4.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Your `p` element should have an opening tag. Opening tags have the following syn
1919
assert.exists(document.querySelector('p'));
2020
```
2121

22+
Your `p` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
23+
24+
```js
25+
assert.notMatch(code, /<\/?P>/);
26+
```
27+
2228
Your `p` element should have a closing tag. Closing tags have a `/` just after the `<` character.
2329

2430
```js

curriculum/challenges/english/blocks/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ Your `h1` element should have an opening tag. Opening tags have this syntax: `<e
2828
assert(document.querySelector('h1'));
2929
```
3030

31+
Your `h1` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
32+
33+
```js
34+
assert.notMatch(code, /<\/?H1>/);
35+
```
36+
3137
Your `h1` element should have a closing tag. Closing tags have a `/` just after the `<` character.
3238

3339
```js

curriculum/challenges/english/blocks/learn-html-by-building-a-cat-photo-app/5dc1798ff86c76b9248c6eb3.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Your `h1` element's text should be `CatPhotoApp`. You have either omitted the te
5252
assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp');
5353
```
5454

55+
Your `h2` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
56+
57+
```js
58+
assert.notMatch(code, /<\/?H2>/);
59+
```
60+
5561
Your `h2` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
5662

5763
```js

curriculum/challenges/english/blocks/learn-html-by-building-a-cat-photo-app/5dc17d3bf86c76b9248c6eb4.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Your `p` element should have an opening tag. Opening tags have the following syn
1919
assert(document.querySelector('p'));
2020
```
2121

22+
Your `p` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
23+
24+
```js
25+
assert.notMatch(code, /<\/?P>/);
26+
```
27+
2228
Your `p` element should have a closing tag. Closing tags have a `/` just after the `<` character.
2329

2430
```js

curriculum/challenges/english/blocks/learn-html-by-building-a-cat-photo-app/5dc2385ff86c76b9248c6eb7.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ Your `main` element should have an opening tag. Opening tags have this syntax: `
2828
assert(document.querySelector('main'));
2929
```
3030

31+
Your `main` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
32+
33+
```js
34+
const mainTagMatches = code.matchAll(/<\/?main>/gi);
35+
for (const match of mainTagMatches) {
36+
const tag = match[0];
37+
assert.strictEqual(
38+
tag,
39+
tag.toLowerCase()
40+
);
41+
}
42+
```
43+
3144
Your `main` element should have a closing tag. Closing tags have a `/` just after the `<` character.
3245

3346
```js

curriculum/challenges/english/blocks/lecture-understanding-html-attributes/66f6db08d55022680a3cfbc9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ HTML, which stands for Hypertext Markup Language, is a markup language for creat
1313
<p>Hello</p>
1414
```
1515

16-
Most elements will have an opening tag and a closing tag. Sometimes those tags are referred to as start and end tags. In between those two tags, you will have the content. This content can be text or other HTML elements. Both opening and closing tags start with a left angle bracket (`<`), and end with a right angle bracket (`>`), with the tag name placed between these angle brackets. Here is a closer look at just the opening and closing paragraph tags:
16+
Most elements will have an opening tag and a closing tag. Sometimes those tags are referred to as start and end tags. In between those two tags, you will have the content. This content can be text or other HTML elements. Both opening and closing tags start with a left angle bracket (`<`), and end with a right angle bracket (`>`), with the tag name placed between these angle brackets. While HTML tag names are case-insensitive, it is a widely accepted convention and best practice to write them in lowercase. Here is a closer look at just the opening and closing paragraph tags:
1717

1818
```html
1919
<p>

curriculum/challenges/english/blocks/workshop-cat-photo-app/5dc174fcf86c76b9248c6eb2.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ Your `h1` element should have an opening tag. Opening tags have this syntax: `<e
2626
assert.exists(document.querySelector('h1'));
2727
```
2828

29+
Your `h1` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
30+
31+
```js
32+
assert.notMatch(code, /<\/?H1>/);
33+
```
34+
2935
Your `h1` element should have a closing tag. Closing tags have this syntax: `</elementName>`.
3036

3137
```js

curriculum/challenges/english/blocks/workshop-cat-photo-app/5dc1798ff86c76b9248c6eb3.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Your `h1` element's text should be 'CatPhotoApp'. You have either omitted the te
3737
assert.equal(document.querySelector('h1')?.innerText?.trim().toLowerCase(), 'catphotoapp');
3838
```
3939
40+
Your `h2` tags should be in lowercase. By convention, all HTML tags are written in lowercase.
41+
42+
```js
43+
assert.notMatch(code, /<\/?H2>/);
44+
```
45+
4046
Your `h2` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
4147
4248
```js

0 commit comments

Comments
 (0)