File: 0691bis.html

package info (click to toggle)
web-mode 17.3.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,164 kB
  • sloc: lisp: 13,359; javascript: 506; jsp: 113; sh: 10; php: 9; makefile: 8; xml: 2
file content (24 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script type="text/babel">
 var data = [
   {id: 1, author: "Pete Hunt", text: "This is one comment"},
   {id: 2, author: "Jordan Walke", text: "This is *another* comment"}
 ];

 var Comment = React.createClass({
   rawMarkup: function() {
     var rm = marked(this.props.children.toString(), {sanitize: true});
     return { __html: rm };
   },

   render: function() {
     return (
       <div className="comment">
	     <h2 className="commentAuthor">
	       {this.props.author}
	     </h2>
	     <span dangerouslySetInnerHTML={this.rawMarkup()} />
       </div>
     );
   }
 });
</script>