3

This is proper rendering?

Sample list

  • [small]
  • [b i g]

    • foo

for this code:

 * `[small]`
 * `[b i g]`

    * foo

the [b i g] should have smaller size. Is this bug or feature?

  • 1
    [b i g] is inside a <p>, which adds padding, while [small] isn't. Odd. – 3ventic Jan 24 '14 at 21:47
5

You have to consider this in terms of element hierarchy. Inside your second list item, your full content is as follows:

`[b i g]`

* foo

That entire block of text has to be rendered through Markdown before it can be placed back inside the parent list item as completed HTML. In markdown, a line-break below a line of text will start a new paragraph. So the first line gets converted to a paragraph and then you start a new list after that, resulting in the final rendering you see.

The only way to get around that is to make Markdown think that there is only one paragraph to be rendered, which means you can't have an extra line-break in between your content anywhere within that single list-item.

So something like this would work:

* `[small]`
* `[b i g]`
    * foo

Rendered version:

  • [small]
  • [b i g]
    • foo

Note that adding another paragraph after the list will result in an oddity where there is no space between the list item and the next line of text, because by default a list inside a list does not have any padding on the bottom.

So this:

* `[small]`
* `[b i g]`

    * foo

  Hello

Would end up looking like this:

  • [small]
  • [b i g]

    • foo

    Hello

You must log in to answer this question.

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