mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-25 22:42:41 +00:00
Fix issue with undefined Style tab data
This commit is contained in:
@@ -122,6 +122,11 @@ const BrewRenderer = createClass({
|
||||
</div>;
|
||||
},
|
||||
|
||||
renderStyle : function() {
|
||||
if(!this.props.style) return;
|
||||
return <div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.props.style} </style>` }} />;
|
||||
},
|
||||
|
||||
renderPage : function(pageText, index){
|
||||
if(this.props.renderer == 'legacy')
|
||||
return <div className='phb page' id={`p${index + 1}`} dangerouslySetInnerHTML={{ __html: MarkdownLegacy.render(pageText) }} key={index} />;
|
||||
@@ -189,7 +194,9 @@ const BrewRenderer = createClass({
|
||||
|
||||
<div className='pages' ref='pages'>
|
||||
{/* Apply CSS from Style tab */}
|
||||
<div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.props.style} </style>` }} />
|
||||
{this.state.isMounted
|
||||
? this.renderStyle()
|
||||
: null}
|
||||
|
||||
{/* Render pages from Markdown tab */}
|
||||
{this.state.isMounted
|
||||
|
||||
Reference in New Issue
Block a user