Fixes#188863Fixes#188958Fixes#188868
This is more reliable than using the regular expressions. However the regular expressions are still needed for inline elements
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
* making markdown link pasting feature smarter
* Update settings description
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* made checkPaste more concise
* won't paste md link in fenced code or math
---------
Co-authored-by: Joyce Er <joyceerhl@gmail.com>
* turning highlighted Mardown text to link to pasted URL
* resolved comments
* resolved more comments
* preserved behavior of existing file pasting logic
---------
Co-authored-by: Meghan Kulkarni <t-mekulkarni@microsoft.com>
Allow copying files in the workspace on markdown drop / paste
Fixes#157043
Also:
- Renames the markdown paste settings and makes them no longer experimental
- Makes the copyFiles setting no longer experimental
- Adds a `markdown.copyFiles.overwriteBehavior` which lets you control if/how existing files are overwritten
For #179430
Adds two new UX components:
- An inline progress icon shown when a drop operation takes over 500ms. This replaces the notification. You can click on it to cancel the drop
- Post drop, a drop feedback icon that lets you drop the file in a different way. This lets you drop the file as plain text for instance instead of as a markdown link
* Revert "Revert "Add experimental setting to define where files should be copied for markdown (#169454)" (#169615)"
This reverts commit b2121c2dbe.
* Fix tests
These paths should always use `/`
* Rework markdown update link glob
Fixes#164587
This changes the `externalFileGlobs` setting to instead be a include array of globs that should trigger link updates. I've split the globs into markdown files and image/video files
This also makes it easier for users to add their own new globs to the list
* Fix scopes
The `asWebviewUri` methods was introduced in VS Code 1.38. It's silly that we still force every single webview to pay the cost of trying to rewrite the old style uris we supported in very old versions of VS Code
Instead I've moved this logic into the extension host and disabled it for all extensions that target VS Code 1.60+ or newer. This means it never applies to internal webviews, notebooks, webview views, or custom editors (these public apis were all introduced after the switch to `asWebviewUri`)