Let's say I want to quote this shell code in a post:
foo=bar
echo $foo
First I put it in code fences so it shows up as code:
```sh
foo=bar
echo $foo
```
Then to quote it, I select it and either press the Blockquote button or Ctrl+Q, but the newlines get converted to spaces, destroying it:
> ```sh foo=bar echo $foo ```
I would expect it to output this:
> ```sh
> foo=bar
> echo $foo
> ```
Which renders as:
foo=bar echo $foo
This issue also affects text in <pre>
tags, but not text indented by four spaces.
Workaround
Use <blockquote>
, though the start tag requires an extra newline, like this:
<blockquote>
```sh
foo=bar
echo $foo
```
</blockquote>
Which renders as:
foo=bar echo $foo
Context
I noticed this while adding content to this answer and experienced the same problem while quoting the code in this question.