Skip to content

Commit

Permalink
refactor: use isInternalUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Feb 29, 2020
1 parent 7564490 commit e6768af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import React, {useCallback, useState} from 'react';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl';

import SearchBar from '@theme/SearchBar';
import Toggle from '@theme/Toggle';
Expand Down Expand Up @@ -81,7 +82,7 @@ function Navbar() {

if (logo.target) {
logoLinkProps = {target: logo.target};
} else if (/http/.test(logoLink)) {
} else if (!isInternalUrl(logoLink)) {
logoLinkProps = {
rel: 'noopener noreferrer',
target: '_blank',
Expand Down

0 comments on commit e6768af

Please sign in to comment.