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 ( return (
<> <>
{props.author} {props.author}
{parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions)} {parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions) || ''}
</> </>
) )
} else { } else {
let rawMd = props.text let rawMd = props.text
if (props.author) rawMd = props.author + ' ' + rawMd if (props.author) rawMd = props.author + ' ' + rawMd
const renderedMarkdown = renderMd(rawMd) const renderedMarkdown = renderMd(rawMd)
return parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions) return (parser.parseWithInstructions(renderedMarkdown, node => node.type !== 'script', processInstructions) || null)
} }
} }
} }