Intelligent Pasting of Lists

Would be cool if Obsidian is somehow able to intelegently detect and modify a paste action. Currently if I have

- [ ] Ticket: PRD External Ingress

And I want to copy it and modify one sections, it looks like

- [ ] Ticket: PRD External Ingress
- [ ] - [ ] Ticket: PRD External Ingress

Would be nice if the - [ ] is excluded somehow if it is detected so it doesn’t duplicate.

12 Likes

Edited the title with more description. Thanks!

2 Likes

Steps to reproduce

I frequently find my self trying to cut/paste a list item from one place to another and I often end up with a duplicate dash. I wish Obsidian would be smarter upon paste in a scenario like this, like some other editors are.

Environment

  • Operating system: macOS
  • Obsidian version: 0.9.11

Additional information

4 Likes

Here’s another use case that I often hit with the same issue:

Kapture 2020-11-12 at 10.04.12

5 Likes

Automatically remove automatically added list-item prefix when appropriate

Use case or problem

  • place caret in line which starts by string "- " (dash, space), optionally preceded by indentation
  • Cut a line “1” using Ctrl+X
  • place cursor to end of another line “2” which also starts by "- " (optionally preceded by indentation)
  • press Enter. Now "- " is added to new line, that is OK.
  • press Ctrl+V to paste the line “1”. Now line starts by "- - "
  • I have to navigate to the line beginning and delete the automatically added "- "

Proposed solution

  • I would prefer automatically added "- " to be removed automatically when pasted content starts by "- " followed by standard text (e.g. alphanumeric character), i.e. pasted text matches markdown list item syntax.

  • Similar situation occurs when caret is at the end of line and delete is pressed. Fixing it by pressing Enter (immediately or later) leads again to "- - ".

    • When curent line starts by string "- " (dash, space), preceded by optional indentation and at the same time caret is followed by "- " and Enter is pressed, then editor should not add another "- " automatically.

Related Feature Requests

keywords: double, duplicate, hyphen, list item, minus, new line, paste

4 Likes

Glad to see this. Somehow I missed it when I made a similar request here: Automatic avoidance of extra bracket set in checkbox formatting

Thanks.

1 Like

Also when using list of multiple levels, pasting behavior now can de a disaster. For example, I want to copy the selected content as shown below:

And I paste them directly to a non-list paragraph, it shows like

I have to make adjustment manually (which could be really difficult for some list with more levels inside)

I know that if I add the bullet point before the selection would work, but is it possible to have a more elegant way?

2 Likes

i very much agree! I created a different request with exactly that issue. This issue particularly harms users copying/pasting from Obsidian into other apps which are essential workplace tools – I’m hoping it can be resolved

link to my request: Copying lists in Obsidian should behave similar to Logseq/Roam (no extra spaces)