When I’m in editor mode I can leave multiple blank lines between text. I find this useful for separating content and making my work more readable. However, when I switch to preview mode the blank lines are stripped and my work is horribly condensed again.
Any chance you would stop preview mode from stripping whitespace, or at least give the option to have preview mode respect blank lines?
Thank you for the CSS snippet, @hieu, but I think the request is not about generally increasing the spacing after every paragraph, as your snippet does; instead, it’s about (sometimes) using multiple empty lines to visually separate some parts/paragraphs from each other. This works well in edit mode (and most other note apps), but in preview mode, all this additional visual structure is lost.
I appreciate people coming up with all kinds of creative workarounds, but they all require you to remember to do something special and potentially even uglify your notes significantly when viewed in edit mode. Plus, most users will simply be annoyed by the existing behavior and not come to the forums to search for some hacky workaround.
I’m cautiously optimistic, though, that this issue will get solved by the planned WYSIWYG editor mode, which is in the short-term section of the Obsidian roadmap.
Just in case someone in the future is looking for this: I found a workaround using an ‘invisible space character’ which creates identical line breaks in live preview as in reading mode:
The <br> is a visible mess. At the moment I can add invisible mess with Invisible Character, but that’s not a good thing. And I’m still looking for a solution, but the blank line doesn’t turn into anything and I can’t style it.
The main problem of most new users who are biased with rich text editors is,
they don’t realize what it means when Obsidian uses markdown to display notes.This is the only problem.
If you want double or multiple line breaks, feel free to try out the community theme Dune. More info here. It won’t transform Obsidian in a WYSIWYG (What You See Is What You Get)- editor but adds a convenient way to add breaks.
One can argue if there should be multiple blank lines in rendered markdown or not - however, there is obvious demand for it. People use stuff in different ways and as long as there is a way to implement something without breaking something else - why not?
That being said I think there is a way to implement this feature without breaking something else, event though I might be wrong, because my markdown knowledge is limited:
If there are multiple blank lines inserted in editor mode, add a OR to the source.
Thats basically an extension of the editor, the souce and the Preview are still markdown compliant.
Both in combination would mean that line breaks in editor mode, in preview mode and when viewing the saved markdown file in a different viewer always look the same. That would make writing stuff for people who come from WYSIWYG-Editors (like mee) just that little easier.
+1, would be useful to have a toggle in settings to allow line breaks to be displayed consistently in editor and reader view (even if this isn’t technically ‘correct’ for markdown)