* 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>
3.0 KiB
3.0 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
bad87fee1348bd9aedf08828 | 创建一个有序列表 | 0 | https://scrimba.com/p/pVMPUv/cQ3B8TM | 16824 | create-an-ordered-list |
--description--
HTML 中有用于创建有序列表的特定元素。
有序列表以 <ol>
开始,中间包含一个或多个 <li>
元素,最后以 </ol>
结束。
例如:
<ol>
<li>加菲猫</li>
<li>哆啦A梦</li>
</ol>
将会创建一个包含加菲猫和哆啦 A 梦的有序列表。
--instructions--
请创建一个有序列表,内容是猫咪最讨厌的三样东西(Top 3 things cats hate:
),内容可以任意指定。
--hints--
应包含一个有序列表,内容是猫咪最讨厌的三样东西(Top 3 things cats hate:
)。
assert(/Top 3 things cats hate:/i.test($('ol').prev().text()));
应包含有一个无序列表,内容是猫咪最喜欢的东西(Things cats love:
)。
assert(/Things cats love:/i.test($('ul').prev().text()));
页面应只包含一个 ul
元素。
assert.equal($('ul').length, 1);
页面应只包含一个 ol
元素。
assert.equal($('ol').length, 1);
ul
无序列表中应包含 3 个 li
元素。
assert.equal($('ul li').length, 3);
ol
有序列表应该包含 3 个 li
元素。
assert.equal($('ol li').length, 3);
ul
无序列表应有结束标签。
assert(
code.match(/<\/ul>/g) &&
code.match(/<\/ul>/g).length === code.match(/<ul>/g).length
);
ol
有序列表应有结束标签。
assert(
code.match(/<\/ol>/g) &&
code.match(/<\/ol>/g).length === code.match(/<ol>/g).length
);
li
元素应有结束标签。
assert(
code.match(/<\/li>/g) &&
code.match(/<li>/g) &&
code.match(/<\/li>/g).length === code.match(/<li>/g).length
);
无序列表里的 li
元素内容不应为空。
$('ul li').each((i, val) =>
assert(__helpers.removeWhiteSpace(val.textContent))
);
有序列表里的 li
元素内容不应该为空。
$('ol li').each((i, val) =>
assert(!!__helpers.removeWhiteSpace(val.textContent))
);
--seed--
--seed-contents--
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
</main>
--solutions--
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>hate 1</li>
<li>hate 2</li>
<li>hate 3</li>
</ol>
</main>