Feat: add new Markdown parser (#39800)

and change all the challenges to new `md` format.
This commit is contained in:
Oliver Eyton-Williams
2020-11-27 19:02:05 +01:00
committed by GitHub
parent a07f84c8ec
commit 0bd52f8bd1
2580 changed files with 113436 additions and 111979 deletions

View File

@@ -4,43 +4,55 @@ title: Part 32
challengeType: 0
---
## Description
<section id='description'>
# --description--
It is time to add a new section. Add a third `section` element below the second `section` element.
</section>
# --hints--
## Tests
<section id='tests'>
```yml
tests:
- text: "Your `section` element should have an opening tag. Opening tags have this syntax: `<elementName>`."
testString: assert( document.querySelectorAll('section').length >= 3 );
- text: You should only add one opening `section` tag. Please remove any extras.
testString: assert( document.querySelectorAll('section').length === 3 );
- text: Your `section` element should have a closing tag. Closing tags have a `/` just after the `<` character.
testString: assert( code.match(/<\/section>/g).length >= 3 );
- text: You should only add one closing `section` tag. Please remove any extras.
testString: assert( code.match(/<\/section>/g).length === 3 );
- text: All of the `section` elements should be between the opening and closing tags of the `main` element.
testString: |
const childrenOfMain = [ ...document.querySelector('main').children ];
const sectionElemsFound = childrenOfMain.filter(child => {
return child.nodeName === 'SECTION';
});
assert( sectionElemsFound.length === 3 );
- text: The last `section` element should have no content. Remove any HTML elements or text within the `section` element.
testString: assert( $('main > section')[2].children.length === 0 );
Your `section` element should have an opening tag. Opening tags have this syntax: `<elementName>`.
```js
assert(document.querySelectorAll('section').length >= 3);
```
</section>
You should only add one opening `section` tag. Please remove any extras.
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```js
assert(document.querySelectorAll('section').length === 3);
```
Your `section` element should have a closing tag. Closing tags have a `/` just after the `<` character.
```js
assert(code.match(/<\/section>/g).length >= 3);
```
You should only add one closing `section` tag. Please remove any extras.
```js
assert(code.match(/<\/section>/g).length === 3);
```
All of the `section` elements should be between the opening and closing tags of the `main` element.
```js
const childrenOfMain = [...document.querySelector('main').children];
const sectionElemsFound = childrenOfMain.filter((child) => {
return child.nodeName === 'SECTION';
});
assert(sectionElemsFound.length === 3);
```
The last `section` element should have no content. Remove any HTML elements or text within the `section` element.
```js
assert($('main > section')[2].children.length === 0);
```
# --seed--
## --seed-contents--
```html
<html>
@@ -53,7 +65,7 @@ tests:
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
<a href="https://freecatphotoapp.com"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
</section>
--fcc-editable-region--
--fcc-editable-region--
<section>
<h2>Cat Lists</h2>
<h3>Things cats love:</h3>
@@ -77,11 +89,9 @@ tests:
<figcaption>Cats <strong>hate</strong> other cats.</figcaption>
</figure>
</section>
--fcc-editable-region--
--fcc-editable-region--
</main>
</body>
</html>
```
</div>
</section>