File tree 2 files changed +3
-2
lines changed
packages/docsify-server-renderer
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'
5
5
import { isAbsolutePath } from '../../src/core/router/util'
6
6
import { readFileSync } from 'fs'
7
7
import { resolve , basename } from 'path'
8
+ import resolvePathname from 'resolve-pathname'
8
9
9
10
function cwd ( ...args ) {
10
11
return resolve ( process . cwd ( ) , ...args )
@@ -131,7 +132,7 @@ export default class Renderer {
131
132
132
133
const fileName = basename ( filePath )
133
134
134
- return await this . _loadFile ( cwd ( filePath , ' ../..' , fileName ) )
135
+ return await this . _loadFile ( resolvePathname ( ` ../${ fileName } ` , filePath ) )
135
136
}
136
137
}
137
138
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export function getPath (...args) {
36
36
}
37
37
38
38
export const isAbsolutePath = cached ( path => {
39
- return / ( : | ( \/ { 2 } ) ) / . test ( path )
39
+ return / ( : | ( \/ { 2 } ) ) / g . test ( path )
40
40
} )
41
41
42
42
export const getParentPath = cached ( path => {
You can’t perform that action at this time.
0 commit comments