mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Merge remote-tracking branch 'upstream/master' into fix-71570
* upstream/master: (34 commits) Fix markdown.styled regression caused by Uri.parse changes Process explorer refactoring fix compile error fix open workspace uri from cli Delete deprecated search provider stub test dependenices are devDependencies Fix default uri when scheme is file disable flaky test, #71801 use `readonly T[]` instead of `ReadonlyArray<T>` simplify protocol check Let enablment service handles local workspace extensions in remote window debt - make ext host init data more complete Fix colorization tests fixes #71671 Update grammars Add yes-no choice for overwriting existing file for save as update distro ExtensionEnablementService: - Remove getDisabledExtensions and instead use isEnabled or getEnablementState methods Simplify reload action and fix test Update distro hash ...
This commit is contained in:
@@ -113,21 +113,19 @@ export class MarkdownContentProvider {
|
||||
return href;
|
||||
}
|
||||
|
||||
// Use href if it is already an URL
|
||||
const hrefUri = vscode.Uri.parse(href);
|
||||
if (['http', 'https'].indexOf(hrefUri.scheme) >= 0) {
|
||||
return hrefUri.toString(true);
|
||||
if (href.startsWith('http:') || href.startsWith('https:') || href.startsWith('file:')) {
|
||||
return href;
|
||||
}
|
||||
|
||||
// Use href as file URI if it is absolute
|
||||
if (path.isAbsolute(href) || hrefUri.scheme === 'file') {
|
||||
// Assume it must be a local file
|
||||
if (path.isAbsolute(href)) {
|
||||
return vscode.Uri.file(href)
|
||||
.with({ scheme: 'vscode-resource' })
|
||||
.toString();
|
||||
}
|
||||
|
||||
// Use a workspace relative path if there is a workspace
|
||||
let root = vscode.workspace.getWorkspaceFolder(resource);
|
||||
const root = vscode.workspace.getWorkspaceFolder(resource);
|
||||
if (root) {
|
||||
return vscode.Uri.file(path.join(root.uri.fsPath, href))
|
||||
.with({ scheme: 'vscode-resource' })
|
||||
|
||||
Reference in New Issue
Block a user