Update Common.js

This commit is contained in:
panda2134
2020-06-23 09:58:07 +08:00
committed by GitHub
parent 5c294acd40
commit 9e98af3660

View File

@@ -136,14 +136,14 @@ export class HighlightedMarkdown extends Component {
return (
<>
{props.author}
{parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions)}
{parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions) || ''}
</>
)
} else {
let rawMd = props.text
if (props.author) rawMd = props.author + ' ' + rawMd
const renderedMarkdown = renderMd(rawMd)
return parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions)
return (parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions) || null)
}
}
}
@@ -307,4 +307,4 @@ export class ClickHandler extends PureComponent {
</div>
)
}
}
}