39 lines
3.5 KiB
Markdown
39 lines
3.5 KiB
Markdown
---
|
||
id: bd7157d8c242eddfaeb5bd13
|
||
title: Build a Markdown Previewer
|
||
isRequired: true
|
||
challengeType: 3
|
||
videoUrl: ''
|
||
localeTitle: 构建Markdown预览器
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/GrZVVO" target="_blank">https</a> <strong>:</strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/GrZVVO</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTML,JavaScript,CSS,Bootstrap,SASS,React,Redux和jQuery的任意组合来完成此项目。您应该使用前端框架(例如React),因为本节是关于学习前端框架的。不建议使用上面未列出的其他技术,使用它们的风险由您自行承担。我们正在寻求支持其他前端框架,如Angular和Vue,但目前不支持它们。我们将接受并尝试修复所有使用建议的技术堆栈的问题报告。快乐的编码! <strong>用户故事#1:</strong>我可以看到一个带有相应<code>id="editor"</code>的<code>textarea</code>元素。 <strong>用户故事#2:</strong>我可以看到一个具有相应<code>id="preview"</code>的元素。 <strong>用户故事#3:</strong>当我文本输入到<code>#editor</code>元件,所述<code>#preview</code>如I型显示textarea的内容元素被更新。 <strong>用户故事#4:</strong>当我在<code>#editor</code>元素中输入GitHub风格的markdown时,文本在我输入的<code>#preview</code>元素中呈现为HTML(提示:您不需要自己解析Markdown - 您可以导入Marked库为此: <a href="https://cdnjs.com/libraries/marked" target="_blank">https</a> : <a href="https://cdnjs.com/libraries/marked" target="_blank">//cdnjs.com/libraries/marked</a> )。 <strong>用户故事#5:</strong>当我的降价预览器首次加载时, <strong>#</strong> <code>#editor</code>字段中的默认文本应包含有效的markdown,它至少代表以下每个元素之一:标题(H1大小),子标题(H2大小) ,链接,内联代码,代码块,列表项,块引用,图像和粗体文本。 <strong>用户故事#6:</strong>首次加载我的降价预览器时, <strong>#</strong> <code>#editor</code>字段中的默认降价应该在<code>#preview</code>元素中呈现为HTML。 <strong>可选的奖励(您不需要进行此测试通过):</strong>我的降价预览器解释回车并将它们呈现为<code>br</code> (换行符)元素。您可以通过分叉<a href="http://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试: <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> : <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后,将URL提交给您的工作通过所有测试的项目。如果卡住,请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests: []
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|