Handle relative urls
This commit is contained in:
parent
6bd53b72b2
commit
2f839c75f7
|
@ -234,6 +234,12 @@ class DocumentScene extends React.Component<Props> {
|
|||
|
||||
onClickLink = (href: string) => {
|
||||
if (isInternalUrl(href)) {
|
||||
// relative
|
||||
if (href[0] === '/') {
|
||||
this.props.history.push(href);
|
||||
}
|
||||
|
||||
// absolute
|
||||
const url = new URL(href);
|
||||
this.props.history.push(url.pathname);
|
||||
} else {
|
||||
|
|
Reference in New Issue