Preserve newline in quote block

Steps to reproduce

Make any quote bock with an empty line of text

Example:

> Foo
>
> Bar

Expected result

Foo

Bar

Actual result

Foo
Bar

Environment

  • Operating system: Linux
  • Obsidian version: 0.6.3
  • Using custom CSS: No

Additional information

2 Likes

Looking at the preview, it looks like the parsing is right, but there’s no margin between the two paragraphs.

CommonMark does not put an explicit newline between the two paragraphs, so I don’t think Obsidian should either.

To test: https://spec.commonmark.org/dingus/

Yeah, I am talking about the preview pane. What I am expecting is a margin (I guess this is how its implemented) between paragraphs.

When I test on https://spec.commonmark.org/dingus/ I do see a margin between paragraphs. Am I doing something wrong?

A quote:

> Quisque tincidunt sit amet magna vel rhoncus. Vivamus ut tortor imperdiet, ornare velit vitae, mattis arcu. Suspendisse potenti. Suspendisse molestie mi quis augue ultrices, id mattis est laoreet.
>
> Integer ac sodales diam, eget interdum lacus. Cras non elementum odio. Sed eu arcu non velit mollis vehicula et sit amet orci.

In Obsidian

image

In https://spec.commonmark.org/dingus/

image


Actually, you just made me realize that I can customize it however I with with the custom css plugin! :grin:

This seems to be working well for me:

blockquote, p:not(:last-child) {
    padding-bottom: 0.7em;
}
4 Likes

I appreciate the CSS solution, but I’d argue this is still a bug from a usability standpoint.

If in edit mode I type

> Here is some text in a blockquote
>
> Here is more text in a blockquote

I would expect that to appear in preview mode as

Screen Shot 2020-07-04 at 12.10.13 AM

(screenshote from commonmark.org)

But Obsidian preview mode still leaves that newline out. I’m fine to use the CSS fix, but I’d suggest this is not commonly expected behavior and would be an easy fix to meet the standard. Thanks for considering!

1 Like

Does this solution work for you? I don’t have any odd CSS that should cause this.

1 Like

Is there going to be any update to this? Or will I have to use a workaround to get the expected behavior?

@Silver I’m not sure you are right on this.

OP’s Markdown is

> Foo
>
> Bar

not

> Foo
> Bar

If you want the CommonMark behavior, turn on “Strict line break” in Settings -> Editor.

Hope that helps!

Okay maybe I’m confused. Is @DadBert not referencing a discrepancy between expected behavior in commonmark and obsidian previews here? That is the problem I’ve been having. Changing that setting fixes my issue though. So I appreciate it.


Yeah, if you want the same behavior, please use the setting. The setting is for people who are not familiar with Markdown’s requirement of two line breaks to separate blocks rather than one.

Sorry about that!