16

I would like to add a quote within a list (ordered or unordered) item. Indentation matters. I would like to have the quotation (blockquote) highlighting-style, not code style. Indenting the > sign removes the quote highlighting.

1 Answer 1

32

This works for me:

* list item 1 > Quote (note: there must be 4 spaces before the `>`, 1-3 spaces after the `>`, and there must be blank lines before and after this quote) Normal, unquoted text. * list item 2 * list item 3 

which renders (with GitHub styling) as:

  • list item 1

    Quote (note: there must be 4 spaces before the >, 1-3 spaces after the >, and there must be blank lines before and after this quote)

    Normal, unquoted text.

  • list item 2

  • list item 3


Make sure you use:

  • four spaces indenting your >
  • one to three spaces between > and your quoted text
  • blank lines before and after the quote

This also works with numbered lists, with the above representing a single list with three items.

Sign up to request clarification or add additional context in comments.

5 Comments

The crucial bit is the blank line preceding the > blockquote indicator. Otherwise, you can indent/prefix the > with two spaces, and drop the blank line after the quote. See git.io/vM731
Is it possible to continue normal text after the quote to still stick to the same list item? I couldn't figure it out yet how to do it.
@Abdull, sure: just skip a line and indent your plain text to align with the >. I've updated my example.
@Chris, thank you very much! It's interesting that once an outline contains such an "normal text after the quote" list item, all other list items will also be wrapped in a <p> element (here at StackOverflow, but also at GitHub). At GitHub, this results in borked format (huge margins between list items), as their CSS rules are matching incorrectly.
@Abdull, that's by design: "A list is loose if any of its constituent list items are separated by blank lines, or if any of its constituent list items directly contain two block-level elements with a blank line between them. Otherwise a list is tight. (The difference in HTML output is that paragraphs in a loose list are wrapped in <p> tags, while paragraphs in a tight list are not.)"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.