<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import * as vscode from 'vscode';

const knownSchemes = ['http:', 'https:', 'file:', 'mailto:'];

export function getUriForLinkWithKnownExternalScheme(
	link: string,
): vscode.Uri | undefined {
	if (knownSchemes.some(knownScheme => link.toLowerCase().startsWith(knownScheme))) {
		return vscode.Uri.parse(link);
	}

	return undefined;
}<commit_msg>Don't try re-encoding vscode-resoure markdown links<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import * as vscode from 'vscode';

const knownSchemes = ['http:', 'https:', 'file:', 'mailto:', 'vscode-resource:'];

export function getUriForLinkWithKnownExternalScheme(
	link: string,
): vscode.Uri | undefined {
	if (knownSchemes.some(knownScheme => link.toLowerCase().startsWith(knownScheme))) {
		return vscode.Uri.parse(link);
	}

	return undefined;
}
{'fraction_non_alphanumeric': 0.34718498659517427, 'fraction_numerical': 0.0, 'mean_word_length': 1.7047101449275361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2764624', 'n_tokens_mistral': 357, 'n_tokens_neox': 356, 'n_words': 100}