Skip to content

Commit

Permalink
Merge pull request reactjs#46 from spicyj/san-md
Browse files Browse the repository at this point in the history
Use marked instead of Showdown and escape HTML
  • Loading branch information
zpao committed Apr 13, 2015
2 parents a91501d + 233dbf7 commit a1eff30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script>
</head>
<body>
<div id="content"></div>
Expand Down
4 changes: 1 addition & 3 deletions public/scripts/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

var converter = new Showdown.converter();

var Comment = React.createClass({
render: function() {
var rawMarkup = converter.makeHtml(this.props.children.toString());
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
return (
<div className="comment">
<h2 className="commentAuthor">
Expand Down

0 comments on commit a1eff30

Please sign in to comment.