forked from newthuhole/hole_thu_frontend
Update Common.js
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -307,4 +307,4 @@ export class ClickHandler extends PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user