Open
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
Pasting a URL overwrites the text
Solution
Pasting a URL in MDX should behave the same way as it does in Markdown in VS Code 1.86 (January 2024):
Want to turn that link you copied into a Markdown link? When you paste a URL into a Markdown file with text selected, VS Code now automatically inserts a Markdown link:
This feature is controlled by the markdown.editor.pasteUrlAsFormattedLink.enabled setting. You can change it to customize this behavior:
- smartWithSelection — The default. This enables the feature when you have selected text and are not inside a special element, such as a code block.
- smart — Same as smartWithSelection but does not require a selection.
- always — Always paste urls as a Markdown links
- never — Disable pasting as Markdown links.
After you've pasted a value, you can always switch to paste the content in a different way by using the Paste control.
Alternatives
A simple implementation:
- just link the selected text with the URL being pasted from the clipboard
- boolean flag to disable the feature