Weird Empty Lines in notes

I recently moved my notes to Obsidian and noticing so many empty lines in the Editor mode (like below). However, when I switch to preview mode, I don’t see them. Anyway to remove them in editor mode as well

Where did you move your notes from, and how did you move them?

Copy-pasting from some apps produces extra blank lines (I don’t know why). You can check if the blank lines are real by enabling Settings > Editor > Show line number.

If the extra blank lines are numbered, you can remove them by using a search-replace that lets you use \n to stand for line breaks. As a starting point, try replacing \n\n with \n. The community plugin Regex Find/Replace supports this. If you have too many notes to process singly, you can use an external text editor that supports it search/replace across multiple files, like Visual Studio Code.

If the extra blank lines aren’t numbered, it’s a style issue that can be solved with CSS (but I think this is less likely).

1 Like

They seem to be numbered but have a weird space in every second line.
image

I exported these notes as MD from Upnote

OK, so you can try the search-replace suggestion above.

Or you can try pasting as plain text if you’re not already, tho I don’t think it’ll work. To try, use Shift+Cmd/Ctrl+V on desktop. On mobile I don’t think you can do it unless you turn Settings > Editor > “Auto convert HTML” off altogether or use an external keyboard (or a third-party soft keyboard that has the appropriate keys).

So I had to use VS Code and did the find and replace of the pattern. The pattern was weird.

<space>\n\n and I replaced it with “” (empty) to remove all these empty lines. The plugin you mentioned wasn’t working that well with that large amount of notes. VS Code worked well. For the most part, it fixed these patterns. Rest I’ll probably fix over time.

1 Like