mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
Rework markdown paste resource (#201838)
Fixes #184980 This refactors much of the logic around markdown paste/drop. PR got a little large but the main highlights are: - Allow using a custom snippet for inserted audio/video - Merge the drop/paste resource provider classes since these are so similar - Enable smart pasting of url text by default - Refactor url paste logic - For now, disable the behavior where url paste could paste a combination of markdown and plain uris. In practice this is confusing, especially because our labels for this were wrong. We can always reintroduce this later if multicursor users find it useful
This commit is contained in:
14
extensions/markdown-language-features/src/util/uriList.ts
Normal file
14
extensions/markdown-language-features/src/util/uriList.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
function splitUriList(str: string): string[] {
|
||||
return str.split('\r\n');
|
||||
}
|
||||
|
||||
export function parseUriList(str: string): string[] {
|
||||
return splitUriList(str)
|
||||
.filter(value => !value.startsWith('#')) // Remove comments
|
||||
.map(value => value.trim());
|
||||
}
|
||||
Reference in New Issue
Block a user