Extracted "safe taint" in docs/homepage to align with best practice #4212

This commit is contained in:
Bradley Spaulding committed 2015-09-21 22:24:51 -07:00
1 parent 56ccd82374
commit 52d8d3b2ff
2 files changed
+10 -5

No files matched your search

+6 -2
View File
@@ -257,14 +257,18 @@ That's React protecting you from an [XSS attack](https://en.wikipedia.org/wiki/C
```javascript{4,10}
// tutorial7.js
var Comment = React.createClass({
render: function() {
rawMarkup: function() {
var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
return { __html: rawMarkup };
},
render: function() {
return (
<div className="comment">
<h2 className="commentAuthor">
{this.props.author}
</h2>
<span dangerouslySetInnerHTML={{"{{"}}__html: rawMarkup}} />
<span dangerouslySetInnerHTML={this.rawMarkup()} />
</div>
);
}