提交 a271fa97 编写于 作者: M Matt Bierner

Fix markdown.styles not resolving relative to root

fixes #33455
上级 61ff2d55
......@@ -153,14 +153,15 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv
return vscode.Uri.file(href).toString();
}
const sourceUri = vscode.Uri.parse(resource.query);
// use a workspace relative path if there is a workspace
let root = vscode.workspace.getWorkspaceFolder(resource);
let root = vscode.workspace.getWorkspaceFolder(sourceUri);
if (root) {
return vscode.Uri.file(path.join(root.uri.fsPath, href)).toString();
}
// otherwise look relative to the markdown file
return vscode.Uri.file(path.join(path.dirname(resource.fsPath), href)).toString();
return vscode.Uri.file(path.join(path.dirname(sourceUri.fsPath), href)).toString();
}
private computeCustomStyleSheetIncludes(uri: vscode.Uri): string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册