File tree Expand file tree Collapse file tree 4 files changed +6
-1
lines changed Expand file tree Collapse file tree 4 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ gem 'coffee-rails', '~> 4.1.0'
14
14
# See https://github.com/rails/execjs#readme for more supported runtimes
15
15
# gem 'therubyracer', platforms: :ruby
16
16
gem 'react-rails' , '~> 1.0'
17
+ gem 'marked-rails'
17
18
18
19
# Use jquery as the JavaScript library
19
20
gem 'jquery-rails'
Original file line number Diff line number Diff line change 72
72
nokogiri (>= 1.5.9 )
73
73
mail (2.6.4 )
74
74
mime-types (>= 1.16 , < 4 )
75
+ marked-rails (0.3.2.0 )
75
76
mime-types (3.1 )
76
77
mime-types-data (~> 3.2015 )
77
78
mime-types-data (3.2016.0521 )
@@ -162,6 +163,7 @@ DEPENDENCIES
162
163
coffee-rails (~> 4.1.0 )
163
164
jbuilder (~> 2.0 )
164
165
jquery-rails
166
+ marked-rails
165
167
rails (= 4.2.1 )
166
168
react-rails (~> 1.0 )
167
169
sass-rails (~> 5.0 )
Original file line number Diff line number Diff line change 16
16
//= require react
17
17
//= require react_ujs
18
18
//= require components
19
+ //= require marked
19
20
//= require_tree .
Original file line number Diff line number Diff line change @@ -33,12 +33,13 @@ var CommentForm = React.createClass({
33
33
34
34
var Comment = React . createClass ( {
35
35
render : function ( ) {
36
+ var rawMarkup = marked ( this . props . children . toString ( ) , { sanitize : true } ) ;
36
37
return (
37
38
< div className = "comment" >
38
39
< h2 className = "commentAuthor" >
39
40
{ this . props . author }
40
41
</ h2 >
41
- { this . props . children }
42
+ < span dangerouslySetInnerHTML = { { __html : rawMarkup } } />
42
43
</ div >
43
44
) ;
44
45
}
You can’t perform that action at this time.
0 commit comments