Fixing a markdown rendering issue
This commit is contained in:
@@ -39,7 +39,7 @@ class Home extends React.Component {
|
||||
if (this.state.tagline === 'rainbow') {
|
||||
return (<em><p className='centered rainbowText'>I hope this CSS rainbow effect works in all browsers!</p></em>);
|
||||
}
|
||||
return (<div className='centered'><em><Markdown source={this.state.tagline} escapeHtml={true} /></em></div>);
|
||||
return (<div className='centered'><em><Markdown data={this.state.tagline} /></em></div>);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,9 +7,9 @@ class Markdown extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
if (props.source !== undefined) {
|
||||
if (props.data !== undefined) {
|
||||
this.state = {
|
||||
data: props.source
|
||||
data: props.data
|
||||
};
|
||||
} else {
|
||||
this.state = {
|
||||
@@ -21,7 +21,7 @@ class Markdown extends React.Component {
|
||||
|
||||
render() {
|
||||
if (this.state.data) {
|
||||
return (<ReactMarkdown source={this.state.data} rehypePlugins={[rehypeRaw]} {...this.props} />);
|
||||
return (<ReactMarkdown children={this.state.data} rehypePlugins={[rehypeRaw]} {...this.props} />);
|
||||
} else {
|
||||
return (<p className='centered'>Loading markdown...</p>);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class News extends React.Component {
|
||||
return (
|
||||
<div className='panel'>
|
||||
{Object.keys(this.state).map((key) => <div key={key}>
|
||||
<ReactMarkdown source={this.state[key]} rehypePlugins={[rehypeRaw]} />
|
||||
<ReactMarkdown children={this.state[key]} rehypePlugins={[rehypeRaw]} />
|
||||
<hr className='newsLine' />
|
||||
</div>)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user