@samitouri / QOS-React / commits / ccfd1ffb30

Replace the code sample in all the languages.

Replace the code sample in all the languages. But I leave below sample code because of wording relation. * tutorial6:see 25ef456 * from tutorial16:see 3812b95

nakazye committed Feb 19, 2016 at 20:01 UTC ccfd1ffb30bd806dcc098c5bf60f9e5988e8b951
4 files changed +12 -9
docs/docs/tutorial.it-IT.md
+1 -1
@@ -258,7 +258,7 @@ Ma c'è un problema! I nostri commenti visualizzati appaiono come segue nel brow
258
259 Questo è il risultato della protezione di React da parte di un [attacco XSS](https://en.wikipedia.org/wiki/Cross-site_scripting). C'è una maniera di aggirare questo comportamento, ma il framework ti avvisa di non farlo:
260
261 -```javascript{4,10}
261 +```javascript{3-6,14}
262 // tutorial7.js
263 var Comment = React.createClass({
264 rawMarkup: function() {
docs/docs/tutorial.ja-JP.md
+9 -6
@@ -233,7 +233,7 @@ Markdown はインラインでテキストをフォーマットする簡単な
233
234 次に、Markdown で書かれたコメントを変換して出力してみましょう。
235
236 -```javascript{2,10}
236 +```javascript{9}
237 // tutorial6.js
238 var Comment = React.createClass({
239 render: function() {
@@ -255,17 +255,21 @@ var Comment = React.createClass({
255
256 このような現象が起きるのは React が XSS 攻撃に対する防御を行っているからです。これを回避する方法はありますが、それを使うときにはフレームワークが警告をします。
257
258 -```javascript{5,11}
258 +```javascript{3-6,14}
259 // tutorial7.js
260 var Comment = React.createClass({
261 - render: function() {
261 + rawMarkup: function() {
262 var rawMarkup = marked(this.props.children.toString(), {sanitize: true});
263 + return { __html: rawMarkup };
264 + },
265 +
266 + render: function() {
267 return (
268 <div className="comment">
269 <h2 className="commentAuthor">
270 {this.props.author}
271 </h2>
268 - <span dangerouslySetInnerHTML={{"{{"}}__html: rawMarkup}} />
272 + <span dangerouslySetInnerHTML={this.rawMarkup()} />
273 </div>
274 );
275 }
@@ -381,8 +385,7 @@ var CommentBox = React.createClass({
385 #### State の更新
386 コンポーネントの作成と同時に、サーバから JSON データを GET で取得し、state を更新して最新のデータを反映させてみましょう。実際のアプリケーションでは動的なエンドポイントになるでしょうが、今回の例では話を簡単にするため、以下の静的な JSON ファイルを使います。
387
384 -```javascript
385 -// tutorial13.json
388 +```json
389 [
390 {"author": "Pete Hunt", "text": "This is one comment"},
391 {"author": "Jordan Walke", "text": "This is *another* comment"}
docs/docs/tutorial.ko-KR.md
+1 -1
@@ -262,7 +262,7 @@ var Comment = React.createClass({
262
263 React는 이런 식으로 [XSS 공격](https://en.wikipedia.org/wiki/Cross-site_scripting)을 예방합니다. 우회할 방법이 있긴 하지만 프레임워크는 사용하지 않도록 경고하고 있습니다:
264
265 -```javascript{4,14}
265 +```javascript{3-6,14}
266 // tutorial7.js
267 var Comment = React.createClass({
268 rawMarkup: function() {
docs/docs/tutorial.zh-CN.md
+1 -1
@@ -258,7 +258,7 @@ var Comment = React.createClass({
258
259 那是 React 在保护你免受 [XSS 攻击](https://en.wikipedia.org/wiki/Cross-site_scripting)。有一个方法解决这个问题,但是框架会警告你别使用这种方法:
260
261 -```javascript{4,10}
261 +```javascript{3-6,14}
262 // tutorial7.js
263 var Comment = React.createClass({
264 rawMarkup: function() {