mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
fix: path/url joining bug on windows (#1064)
* fix error while using multiple level directory * fix error while using non-english file name
This commit is contained in:
parent
12fd204840
commit
8663a63e7d
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ const path = require('path');
|
|||
const escapeStringRegexp = require('escape-string-regexp');
|
||||
|
||||
function getSubDir(file, refDir) {
|
||||
const subDir = path.dirname(path.relative(refDir, file)).replace('\\', '/');
|
||||
const subDir = path.dirname(path.relative(refDir, file)).replace(/\\/g, '/');
|
||||
return subDir !== '.' && !subDir.includes('..') ? subDir : null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue