Quantcast
Channel: Active questions tagged code-formatting - Meta Stack Overflow
Viewing all articles
Browse latest Browse all 180

Pressing the quote button destroys text in code fences

$
0
0

Let's say I want to quote this shell code in a post:

foo=barecho $foo

First I put it in code fences so it shows up as code:

```foo=barecho $foo```

Then to quote it, I select it and either press the Quote button or Ctrl+Q, but the newlines get converted to spaces, destroying it:

> ``` foo=bar echo $foo ```

I would expect it to output this:

> ```> foo=bar> echo $foo> ```

Which renders as:

foo=barecho $foo

This 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>```foo=barecho $foo```</blockquote>

Which renders as:

foo=barecho $foo

Context

I noticed this while adding content to this answer and experienced the same problem while quoting the code in this question.


Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>