Tutorial: show how to add showdown.js

This commit is contained in:
Brian Rue 2013-08-30 16:29:01 -07:00
parent 75aee1714b
commit 403b087e97
1 changed files with 11 additions and 1 deletions

View File

@ -203,7 +203,17 @@ By surrounding a JavaScript expression in braces inside JSX (as either an attrib
Markdown is a simple way to format your text inline. For example, surrounding text with asterisks will make it emphasized.
First, add the third-party **Showdown** library to your application. This is a JavaScript library which takes Markdown text and converts it to raw HTML. This requires a script tag in your head (which we have already included in the React playground).
First, add the third-party **Showdown** library to your application. This is a JavaScript library which takes Markdown text and converts it to raw HTML. This requires a script tag in your head (which we have already included in the React playground):
```html{6}
<!-- template.html -->
<head>
<title>Hello React</title>
<script src="http://fb.me/react-{{site.react_version}}.js"></script>
<script src="http://fb.me/JSXTransformer-{{site.react_version}}.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
</head>
```
Next, let's convert the comment text to Markdown and output it: