What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Here's a problem (at least it seems like a problem) I noticed in the first couple revisions of this question. Based on experiments shown below, when I include within a <pre> block lines that start with one or more spaces, they appear as a nested pre-area in the question, and if there are enough of these lines, I get two scrollbars, one for the nested <pre> (which seems to be created by the Markdown parser) and one for the outer <pre> (which is explicitly given in the question). I'd expect to get only one <pre> in the rendered question, the one that I explicitly include.

Example:

line of code

line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code
line of code

line of code line of code

share|improve this question

2 Answers 2

The problem isn't the indentation - it's the broken HTML!

It's easier to see if you strip out all the code and just look at the markup:

<pre>
...code and stuff...
</pre></code>

Two problems with this:

  1. There's no opening <code> tag
  2. <pre> can't be nested within <code> blocks anyway. The author probably meant to do just the opposite.

Fix those two issues, and the problem goes away...

share|improve this answer

The obvious answer is not to format your code with HTML tags. Doing so never works properly and means that those of use that want to copy & paste into an external editor or IDE have to do some extra editing.

share|improve this answer
1  
I know, I always indent my code so this isn't a problem for me. The question I found this in was asked by somebody else. And yes, I know it's bad style, but that doesn't keep it from indicating a bug. –  David Z May 21 '10 at 13:16
    
What do you mean, never? Sometimes it works! –  SamB Feb 7 '12 at 1:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .