Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting markdown style link with label makes nested link #6800

Open
kcarnold opened this issue Sep 20, 2022 · 3 comments
Open

Pasting markdown style link with label makes nested link #6800

kcarnold opened this issue Sep 20, 2022 · 3 comments
Labels
can-be-reproduced editor:copy-paste Clipboard data attached is appreciated. See menu - bug report - clipboard inspector :type/enhancement Enhancement to product. Does not affect the overall basic use.

Comments

@kcarnold
Copy link
Contributor

What happened?

I regularly use the feature of copying a URL, selecting some text in Logseq, and pasting to link to that text. But sometimes I copy some text instead. When I paste I expect it to replace the highlighted text with what was in the clipboard. But instead it tries to make a link, which makes at best a broken link and at worst some malformed Markdown.

This could be viewed as just "user error" since in every case I can think of I could have done something different, but I still stumble on it often, and it should be not too hard to check that the thing you're pasting is actually a valid link target. (Some non-URLs could be link targets, like asset file paths, so maybe this is a bit tricky.)

Reproduce the Bug

  1. Type some text.
  2. Copy some other text that's NOT a URL
  3. Select some of the text you typed.
  4. Paste (ctrl/command-V)

Expected Behavior

The selected text is replaced by the text on the clipboard, since it wasn't a valid link target.

Screenshots

No response

Desktop Platform Information

macOS 12.6, app 0.8.7

Mobile Platform Information

No response

Additional Context

No response

@kcarnold
Copy link
Contributor Author

Related issue: #4701

@cnrpman cnrpman added the editor:copy-paste Clipboard data attached is appreciated. See menu - bug report - clipboard inspector label Sep 21, 2022
@cnrpman
Copy link
Collaborator

cnrpman commented Sep 21, 2022

@kcarnold Can you provide the item you pasted?

@cnrpman cnrpman added need-to-reproduce More clues are required to reproduce the issue. awaiting-response Issue will be closed if a reply is not received labels Sep 21, 2022
@kcarnold
Copy link
Contributor Author

Specific example: first I paste https://github.com/d3/d3-sankey, then I go back and use my bookmarklet to copy [d3/d3-sankey: Visualize flow between nodes in a directed acyclic network.](https://github.com/d3/d3-sankey). I select what I'd originally pasted and press Paste again. Result: [https://github.com/d3/d3-sankey]([d3/d3-sankey: Visualize flow between nodes in a directed acyclic network.](https://github.com/d3/d3-sankey))

@cnrpman cnrpman added can-be-reproduced :type/enhancement Enhancement to product. Does not affect the overall basic use. and removed awaiting-response Issue will be closed if a reply is not received need-to-reproduce More clues are required to reproduce the issue. labels Sep 27, 2022
@cnrpman cnrpman changed the title Pasting something that isn't a URL still tries to make a link Pasting markdown style link with label makes nested link Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-be-reproduced editor:copy-paste Clipboard data attached is appreciated. See menu - bug report - clipboard inspector :type/enhancement Enhancement to product. Does not affect the overall basic use.
Projects
Status: 🗄 Backlog
Development

No branches or pull requests

2 participants