You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not paste URL as formatted when pasting inside a word #186289
bugIssue identified by VS Code Team member as probable bugmarkdown-extThe Markdown extension: language features and previewverifiedVerification succeeded
Imagine that I am a user that is unaware of the cool new feature that we have. I just wrote the following [Microsoft](*), and the cursor is at the * location and I now want to paste https://microsoft.com. What I will get is [Microsoft]([Title](https://www.microsoft.com/))
Can we be a bit smarter to handle this case? Some heuristics we could potentially apply:
Do not format URL on paste if you are in the middle of a word
Do not format URL if you are inside a link
Reacted by Carlo Cardella, Greg Van Liew, Lea Verou, Alex Weininger and zhouxinghong
Meghan Kulkarni (@MeghanKulkarni) It's likely too late to try working on this in the current iteration, but consider how you might do so in the future and how you would make sure the feature is future proofed
In this case, in the future we may be able to make this feature smarter but some users may still want the existing behavior where pasting a link always (and predictably) inserts a link
One idea would to use an enum value for markdown.editor.pasteUrlAsFormattedLink.enabled with values such as:
always — The current default
smart — A new value to be added in the future. This would try to intelligently infer when a link should be created
never — Turn off the feature (same as false today)
For now we'd only ship with the always and never enum values. Then next iteration you can work on implementing smart (and potentially make it the new default too)
Reacted by Carlo Cardella, Isidor Nikolic, Meghan Kulkarni and Luis Herranz
I believe this has been fixed/implemented. With smart, we now only paste as a link if you have a selection and are not already inside something that looks like a markdown link
bugIssue identified by VS Code Team member as probable bugmarkdown-extThe Markdown extension: language features and previewverifiedVerification succeeded
Activity
mjbvz commentedon Jun 27, 2023
Meghan Kulkarni (@MeghanKulkarni) It's likely too late to try working on this in the current iteration, but consider how you might do so in the future and how you would make sure the feature is future proofed
In this case, in the future we may be able to make this feature smarter but some users may still want the existing behavior where pasting a link always (and predictably) inserts a link
One idea would to use an enum value for
markdown.editor.pasteUrlAsFormattedLink.enabledwith values such as:always— The current defaultsmart— A new value to be added in the future. This would try to intelligently infer when a link should be creatednever— Turn off the feature (same as false today)For now we'd only ship with the
alwaysandneverenum values. Then next iteration you can work on implementingsmart(and potentially make it the new default too)isidorn commentedon Jun 28, 2023
I like that idea Matt. +1 on making smart the default once we are happy with it.
mjbvz commentedon Jan 8, 2024
I believe this has been fixed/implemented. With
smart, we now only paste as a link if you have a selection and are not already inside something that looks like a markdown link