0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 12:52:42 +00:00
This commit is contained in:
Scott
2015-12-19 23:16:35 -05:00
parent 144476d363
commit 1b1860bb0a
25 changed files with 52 additions and 11 deletions

View File

@@ -0,0 +1,28 @@
var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Markdown = require('marked');
var Phb = React.createClass({
getDefaultProps: function() {
return {
text : ""
};
},
renderPages : function(){
return _.map(this.props.text.split('\\page'), (pageText, index) => {
return <div className='phb' dangerouslySetInnerHTML={{__html:Markdown(pageText)}} key={index} />
})
},
render : function(){
var self = this;
return <div className="pbhPages">
{this.renderPages()}
</div>;
}
});
module.exports = Phb;