Skip to content

Commit

Permalink
using markup for html
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashdown committed Sep 10, 2015
1 parent f6ff9a9 commit c0544f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@
<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/marked/0.3.2/marked.min.js"></script>
</head>
<body>
<div id="content"></div>
<script type="text/jsx">

var Comment = React.createClass({

render: function() {
var rawMarkup = marked(this.props.children.toString(), {sanitize:true});
return (
<div class="comment">
<h2 class="commentAuthor">
{this.props.author}
</h2>
{this.props.children}
<span dangerouslySetInnerHTML={{__html: rawMarkup}} />
</div>
);
}
Expand Down

0 comments on commit c0544f4

Please sign in to comment.