diff --git a/src/transform/plugins/links/index.ts b/src/transform/plugins/links/index.ts index 314228d5..42daa765 100644 --- a/src/transform/plugins/links/index.ts +++ b/src/transform/plugins/links/index.ts @@ -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[]) { @@ -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({