Skip to content

Commit 50527c9

Browse files
authored
Use desired file name when generating new md pasted file paths (microsoft#183861)
Fixes microsoft#183851
1 parent 5f37021 commit 50527c9

File tree

1 file changed

+3
-3
lines changed
  • extensions/markdown-language-features/src/languageFeatures/copyFiles

1 file changed

+3
-3
lines changed

extensions/markdown-language-features/src/languageFeatures/copyFiles/copyFiles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
import * as path from 'path';
65
import * as picomatch from 'picomatch';
76
import * as vscode from 'vscode';
87
import { Utils } from 'vscode-uri';
@@ -43,8 +42,9 @@ export class NewFilePathGenerator {
4342
const desiredPath = getDesiredNewFilePath(config, document, file);
4443

4544
const root = Utils.dirname(desiredPath);
46-
const ext = path.extname(file.name);
47-
const baseName = path.basename(file.name, ext);
45+
const ext = Utils.extname(desiredPath);
46+
let baseName = Utils.basename(desiredPath);
47+
baseName = baseName.slice(0, baseName.length - ext.length);
4848
for (let i = 0; ; ++i) {
4949
if (token.isCancellationRequested) {
5050
return undefined;

0 commit comments

Comments
 (0)