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