Fix/open book spcl characters (#9888)

* upgrade fast-glob that escapes them.

* added tests

* added test with brackets in bookPath
This commit is contained in:
Maddy
2020-04-07 15:55:53 -07:00
committed by GitHub
parent f056086662
commit 6bc123d76b
4 changed files with 105 additions and 34 deletions

View File

@@ -61,7 +61,7 @@ export class BookModel implements azdata.nb.NavigationProvider {
maxDepth = undefined;
}
let p: string = path.join(folderPath, '**', '_data', 'toc.yml').replace(/\\/g, '/');
let p: string = path.posix.join(glob.escapePath(folderPath.replace(/\\/g, '/')), '**', '_data', 'toc.yml');
let tableOfContentPaths: string[] = await glob(p, { deep: maxDepth });
if (tableOfContentPaths.length > 0) {
this._tableOfContentPaths = this._tableOfContentPaths.concat(tableOfContentPaths);