hyperlink-academy / leaflet

https://leaflet.pub
3 stars 1 forks source link

Sub-lists sometimes fail to paste in #91

Open bschlagel opened 3 weeks ago

bschlagel commented 3 weeks ago

Seeing an issue where pasting in a sub-list (i.e. from Obsidian, a portion of a list that doesn't include the top level bullets) it either pastes incorrectly or fails to paste at all. Examples—

Copying part of a list (selecting just before the - in first item):

- sub-item
        - grandchild 1
        - grandchild 2

…results in a flattened single list item like: - sub-item - grandchild 1 - grandchild 2

Copying to the beginning of the first line of the sub item (i.e. including the extra tab char):

    - sub-item
        - grandchild 1
        - grandchild 2

…results in nothing pasting at all.

I think in both cases ideally they paste as a top level list (or whatever indentation level you're on, if already in a list)…so I guess that'd mean a) stripping extra tab chars w/in nested list items and b) similarly stripping whitespace before list items.

(Not high priority…workaround is just to outdent a list to top level first before copying, just a bit annoying. Also kinda janky in Obsidian, though slightly better b/c paste never fails entirely.)