Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

2.0 KiB
Raw Blame History

id, title, challengeType, dashedName
id title challengeType dashedName
5dc24614f86c76b9248c6ebd Part 10 0 part-10

--description--

You can link to another page with the anchor (a) element. For example, would link to freecodecamp.org.

Add an anchor element after the paragraph that links to https://freecatphotoapp.com. At this point, the link wont show up in the preview.

--hints--

Your anchor (a) element should have an opening tag. Opening tags have this syntax: <elementName>.

assert(document.querySelector('a'));

Your anchor (a) element should have a closing tag. Closing tags have a / just after the < character.

assert(code.match(/<\/a\>/));

Your anchor (a) element should be below the p element. You have them in the wrong order.

const collection = [...document.querySelectorAll('a, p')].map(
  (node) => node.nodeName
);
assert(collection.indexOf('P') < collection.indexOf('A'));

Your anchor (a) element does not have an href attribute. Check that there is a space after the opening tag's name and/or there are spaces before all attribute names.

assert(document.querySelector('a').hasAttribute('href'));

Your anchor (a) element should link to https://freecatphotoapp.com. You have either omitted the URL or have a typo.

assert(
  document.querySelector('a').getAttribute('href') ===
    'https://freecatphotoapp.com'
);

Although you have set the anchor ('a') element's href attribute to the correct link, it is recommended to always surround the value of an attribute with quotation marks.

assert(
  !/\<a\s+href\s*=\s*https:\/\/www.freecodecamp.org\/cat-photos/.test(code)
);

--seed--

--seed-contents--

<html>
  <body>
    <h1>CatPhotoApp</h1>
    <main>
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
--fcc-editable-region--
      <p>Click here to view more cat photos.</p>
--fcc-editable-region--
      <img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">
    </main>
  </body>
</html>