Skip to content

Do not paste URL as formatted when pasting inside a word #186289

Closed

Description

Testing #186236

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

Activity

  1. mjbvz commented on Jun 27, 2023

    @mjbvz
    Contributor

    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)

  2. isidorn commented on Jun 28, 2023

    @isidorn
    Author

    I like that idea Matt. +1 on making smart the default once we are happy with it.

  3. added
    bug
    markdown-ext
    on Dec 4, 2023
  4. added this to the Backlog milestone on Dec 5, 2023
  5. mjbvz commented on Jan 8, 2024

    @mjbvz
    Contributor

    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

  6. modified the milestones: Backlog, on Jan 8, 2024
  7. locked and limited conversation to collaborators on Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugmarkdown-extverified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions