diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index f5f194f12..763a54092 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -237,13 +237,19 @@ class DocumentScene extends React.Component { onClickLink = (href: string) => { if (isInternalUrl(href)) { // relative - if (href[0] === '/') { - this.props.history.push(href); + let navigateTo = href; + + // probably absolute + if (href[0] !== '/') { + try { + const url = new URL(href); + navigateTo = url.pathname; + } catch (err) { + navigateTo = href; + } } - // absolute - const url = new URL(href); - this.props.history.push(url.pathname); + this.props.history.push(navigateTo); } else { window.open(href, '_blank'); }