Skip to content

Commit

Permalink
fix: change isAbsolute to includes double slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
makamekm committed May 16, 2024
1 parent 9baacd7 commit 5e5ef7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transform/plugins/links/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {getFileTokens, isFileExists} from '../../utilsFS';
import Token from 'markdown-it/lib/token';
import {Logger} from 'src/transform/log';
import {MarkdownItPluginCb, MarkdownItPluginOpts} from '../typings';
import path, {parse, relative, resolve} from 'path';
import path, {isAbsolute, parse, relative, resolve} from 'path';
import {StateCore} from 'src/transform/typings';

function getTitleFromTokens(tokens: Token[]) {
Expand Down Expand Up @@ -185,7 +185,7 @@ function processLink(state: StateCore, tokens: Token[], idx: number, opts: ProcO

let newPathname = '';

if (!href.includes('//')) {
if (!isAbsolute(href) && !href.includes('//')) {
newPathname = getPublicPath(opts, file);

href = url.format({
Expand Down

0 comments on commit 5e5ef7d

Please sign in to comment.