File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/docsify-server-renderer Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Compiler } from '../../src/core/render/compiler'
55import { isAbsolutePath } from '../../src/core/router/util'
66import { readFileSync } from 'fs'
77import { resolve , basename } from 'path'
8+ import resolvePathname from 'resolve-pathname'
89
910function cwd ( ...args ) {
1011 return resolve ( process . cwd ( ) , ...args )
@@ -131,7 +132,7 @@ export default class Renderer {
131132
132133 const fileName = basename ( filePath )
133134
134- return await this . _loadFile ( cwd ( filePath , ' ../..' , fileName ) )
135+ return await this . _loadFile ( resolvePathname ( ` ../${ fileName } ` , filePath ) )
135136 }
136137 }
137138}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export function getPath (...args) {
3636}
3737
3838export const isAbsolutePath = cached ( path => {
39- return / ( : | ( \/ { 2 } ) ) / . test ( path )
39+ return / ( : | ( \/ { 2 } ) ) / g . test ( path )
4040} )
4141
4242export const getParentPath = cached ( path => {
You can’t perform that action at this time.
0 commit comments