Support for ```quote ...```

If I want to quote several lines, I need to add > at the beginning of every line.

This is doable, but not convenient.

Zulip supports “quote” after the trible backticks.

It would be great to have this in commonmarkdown.

```quote
line1
line2
line

What do you think?

No need. Markdown since the beginning has supported being “lazy” with both block quotes and list items:

> line1
line2
line

- line1
line2
line

All variants support this.

1 Like

Thank you for you reply!

If I use this:

> foo
bar
baz

Then it gets rendered as

foo bar baz

I would like to keep the line breaks, like the triple quotes do it.

use-case:

I copy some text from a an email to a markdown chat application.

I want the text to look like a quoted text.

And I want to keep the line-breaks.

Is there already something like this?

If the copy-pasted email is just plain text, and if it is not critical that it renders specifically as a block quote, you can just put it in a code block:

```
line1
line2
line
````

which renders here on Discourse as:

line1
line2
line

You can even add “quote” to the opening triple backticks if you want.

Also, per the CommonMark spec, whether line breaks are preserved in non-code blocks is up to the renderer. For example, in GitHub comments, which are GFM-based and thus a CommonMark superset, line breaks are preserved, including in block quotes. Many CommonMark tools and renderers have this as a user option, e.g. CommonMark.js (see it’s softbreak option), Markdown-it, Typora, etc.

You can also force a line break with \ or two spaces at the and of a line.

Finally, please note the announcement at the top of this forum. If you’ve already dismissed it, log out (and maybe clear cookies) or open the forum in a private browser mode window to have it appear again.

I think that is a good approach @guettli .

No need. Markdown since the beginning has supported being “lazy” with both block quotes and list items:

The problem is that paragraphs break lazy continuation lines. So you always have to fiddle with the formatting in the middle of the quote if you want to quote multiple paragraphs instead of just adding start-block and end-block. What I often do is manually add > to the start of every paragraph.

(Or this is how I’ve always done it. Maybe I’m too lazy and there’s a better way.)

This is very inconvenient when Markdown is used as a forum markup—where you constantly want to reply to specific parts of a post.