I am trying to paste list items (bulleted or numbered) from outside Obsidian to Obsidian to a note.
When I paste the list, it is pasted as follows:
- List Item 1
- List Item 2
- List Item 3
(Four spaces empty line is added between each list item).
This could be probably the paragraph or line breaks in the text I copied from.
I want to remove this and paste the list without those empty lines.
Things I have tried
I tried to use Linter plugin, but couldn’t find a solution that will only remove this empty line without touching rest of the content in the notes.
Expected Output
- List Item 1
- List Item 2
- List Item 3
Is there any solution to this? Currently, I have to manually remove all such empty lines (sometimes even when the list is so long, the only way to do this is manual - hence this query for help.)
Ok, this is clearly not perfect/ideal but you potentially could then select the 3 lines, right-click on the selection and select Bullet list under the Paragraph menu …
Perhaps PDF Paste plugin. In my experience it is very good at picking up unwanted newlines and such, but retains other formatting, so presumably bullets as well.
I have a slightly more convenient work-around for this. It doesn’t automatically remove the space upon pasting, but you can remove all the extra blank lines in a few seconds.
In google docs, you can enable regular expressions in Replace & Find, to remove all extra blank lines by entering \n(?=\n) in ‘Find’, nothing in ‘replace’. This can be applied to Obsidian with the help of the community plugin ‘Regex Find/Replace’.
in settings → third-party plugins → browse community plugins → type in Regex → download it
go back to third-party plugins → scroll down to find Regex → find the gear icon at the right side → set hotkeys to something you remember (i recommend Ctrl + J cuz it’s near Ctrl + F and doesn’t conflict with other hotkeys)
open Regex’s Replace/Find with the hotkey, enter \n(?=\n) in ‘Find’, nothing in ‘replace’. By nothing, I mean blank, no need to enter anything
This should remove all the extra blank lines between paragraphs. This is convenient for me as a novel writer, but I don’t know if it’d be extra work for you to re-enter those blank lines between sections. Hopefully this will help someone.