freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/front-end-libraries-projects/build-a-markdown-previewer....

39 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSSBootstrapSASSReactRedux和jQuery的任意组合来完成此项目。您应该使用前端框架例如React因为本节是关于学习前端框架的。不建议使用上面未列出的其他技术使用它们的风险由您自行承担。我们正在寻求支持其他前端框架如Angular和Vue但目前不支持它们。我们将接受并尝试修复所有使用建议的技术堆栈的问题报告。快乐的编码 <strong>用户故事1</strong>我可以看到一个带有相应<code>id=&quot;editor&quot;</code><code>textarea</code>元素。 <strong>用户故事2</strong>我可以看到一个具有相应<code>id=&quot;preview&quot;</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>