@@ -154,7 +154,7 @@ export const customLinkRenderer = (href, text, repoUrl, gitBranchName) => {
154154 }
155155 // Only target relative URLs, which are used to refer to the git repo, and not anchors or absolute URLs
156156 const urlIsRelative = utils . isUrlRelative ( href ) ;
157- if ( urlIsRelative ) {
157+ if ( urlIsRelative && repoUrl ) {
158158 const urlPrefix = generateGitRepoUrlPrefix ( repoUrl , gitBranchName , href ) ;
159159 // Since the README will always be in the root, the hrefs will have the same prefix, which needs to be taken off for the URL
160160 const cleanedHref = href . startsWith ( './' ) ? href . replace ( './' , '' ) : href ;
@@ -177,7 +177,7 @@ export const customLinkRenderer = (href, text, repoUrl, gitBranchName) => {
177177export const customImageRenderer = ( href , text , repoUrl , gitBranchName ) => {
178178 // Only target relative URLs, which are used to refer to the git repo, and not anchors or absolute URLs
179179 const urlIsRelative = utils . isUrlRelative ( href ) ;
180- if ( urlIsRelative ) {
180+ if ( urlIsRelative && repoUrl ) {
181181 const urlPrefix = generateRawGitRepoUrlPrefix ( repoUrl , gitBranchName ) ;
182182 // Since the README will always be in the root, the hrefs will have the same prefix, which needs to be taken off for the URL
183183 const cleanedHref = href . startsWith ( './' ) ? href . replace ( './' , '' ) : href ;
0 commit comments