handle malformed markdown links

This commit is contained in:
Sean Yesmunt 2020-11-19 15:24:58 -05:00
parent 505bae77ac
commit c822f1702f

View file

@ -18,9 +18,13 @@ type Props = {
function MarkdownLink(props: Props) {
const { children, href, title, embed = false, parentCommentId, isMarkdownPost, simpleLinks = false } = props;
const decodedUri = decodeURI(href);
if (!href) {
let decodedUri;
try {
decodedUri = decodeURI(href);
} catch (e) {}
if (!href || !decodedUri) {
return children || null;
}