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

Markdown:

1. Item 1
1. Item 2

1. Item 3
1. Item 4
1. Item 5

Now outputted as:

  1. Item 1
  2. Item 2

  3. Item 3

  4. Item 4
  5. Item 5

The visual gap after item 3 appears to be an error. If I stick anything non-list between items 2 and 3 (say, <!-- . -->) the symptom disappears.

Also happens with a nested list:

1. Item 1
1. Item 2
    - Sub Item

1. Item 3

...now showing as:

  1. Item 1
  2. Item 2

    • Sub Item
  3. Item 3

The same when explicitly adding blank lines for readability, but only for sub lists that have a single item, not for sub lists that have multiple items. Note that, despite the additional blank lines, Markdown correctly sees this as a single list, and the browser correctly increases the numbered items for that:

1. Item 1

    1. Sub Item 1a

    1. Sub Item 1b

1. Item 2

    - Sub Item 2a

1. Item 3

    - Sub Item 3a

    - Sub Item 3b

1. Item 4

Which now renders as:

  1. Item 1

    1. Sub Item 1a

    2. Sub Item 1b

  2. Item 2

    • Sub Item 2a
  3. Item 3

    • Sub Item 3a

    • Sub Item 3b

  4. Item 4

share|improve this question
    
Hmm, the specific trigger causing this seems to have intentionally been put into place, although I can't immediately understand why. If it's resolved, you'll get a single list with five items and no mysterious space - is that what you were expecting? –  Tim Stone Nov 10 '11 at 0:55
    
I added another example; something similar bit me on meta.stackexchange.com/questions/111421/… if you look at the spacing between all the list items except after the sub-list. –  agf Nov 10 '11 at 2:37
    
@Tim: It should be two lists, with one gap between items 2 and 3. –  Lightness Races in Orbit Nov 10 '11 at 10:03
    
@Tomalak, I raised a similar issue a while back, and there's a few additional work-arounds listed in answers there which you might find helpful. –  DMA57361 Nov 10 '11 at 10:19
    
@DMA57361: I don't need a workaround; I am posting because I want it to be fixed! Surely the "by design" should be removed if nobody can figure out why this is so. –  Lightness Races in Orbit Nov 10 '11 at 10:20
    
Oh, I know @Tomalak, that's also why I originally posted mine too, but I believe they don't seem interested in fixing this - and consider it a non-bug - because the problem apparently sits with Markdown itself, not SE (see Jeff's comment on mine). –  DMA57361 Nov 10 '11 at 12:11
    
@DMA57361 Yeah, the Markdown specification deliberately describes this as being the correct behaviour. –  Tim Stone Nov 15 '11 at 17:54
    
@TimStone: There's a word for that :P –  Lightness Races in Orbit Nov 15 '11 at 18:05
    
@balpha, I added another example, which I think is the same issue. (If not, then a rollback is in place.) Do you think that is by-design too? (Real life example here.) –  Arjan Apr 9 '12 at 12:17
1  
@Arjan Yes. See my answer here for some details. The Markdown converter is working according to spec. If anything, this is a CSS issue. –  balpha Apr 9 '12 at 12:36
    
Nice reference, @balpha. But - Sub Item 2a in the last example above is also surrounded by whitespace but not embedded in <p>s in the result...? (Instead: <ul> <li>Sub Item 2a</li> </ul>) –  Arjan Apr 9 '12 at 12:41
    
@Arjan Those newlines belong to the outer list. The inner list only has one item. –  balpha Apr 9 '12 at 12:43
    
True, @balpha (sorry for bothering you), but in the Markdown the inner list is surrounded by whitespace too... (I had to add some comments here to get consistent whitespace into this too long of a list. But of course we know Markdown can't be expected to handle all.) –  Arjan Apr 9 '12 at 12:46

1 Answer 1

If you look at the generated HTML, it goes like this:

<ul>
<li>One</li>
<li><p>Two</p></li>
<li><p>Three</p></li>
<li>Four</li>
<li>Five</li>
</ul>

The Two has a blank line below it, so it's a paragraph. The Three has a blank line above it, so it's also a paragraph. Paragraphs on Stack Overflow have bottom margins set.

So a possible temporary fix is to just specify your lists in HTML.

share|improve this answer
5  
So a possible temporary fix is to just specify your lists in HTML. Grrrrrrrrrrrr... –  Time Traveling Bobby Nov 10 '11 at 8:03
    
OK, but that's not a "we fixed it!" answer :P –  Lightness Races in Orbit Nov 10 '11 at 10:03
2  
@TomalakGeret'kal: I wish they did... how is that "by design?" –  U2744 SNOWFLAKE Nov 10 '11 at 18:08
2  
@minitech: I have no idea. I don't really care whose fault it is; if this bug is blocked on something in Markdown then fine, but that doesn't make it a non-issue and it certainly doesn't make it "by design"; it makes it blocked. –  Lightness Races in Orbit Nov 10 '11 at 18:25

You must log in to answer this question.

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