Fixing a markdown rendering issue

This commit is contained in:
2022-11-14 00:10:31 +11:00
committed by GitHub
parent ab7053f594
commit 961dc0e20f
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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 (
+3 -3
View File
@@ -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>);
}
+1 -1
View File
@@ -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>