I'm unable to get an XML code sample to be formatted correctly when used as part of a numerated or bulleted list. The XML doesn't format correctly regardless of whether I toggle the 'code formatting' or 'quote' buttons. The tags just don't appear at all and instead, the content outside the tags is show.

Original post: I'm having some trouble formatting some XML correctly in an answer and was wondering if someone could help me out.

URL: android: set textColor with textAppearance attribute

I've taken a look at this answer which doesn't seem to help: Posting XML in Stack Overflow

I've had to put a full stop (.) in the tags causing problems <style> and <item>; otherwise they don't appear at all.

Thanks for your help.

  • 8
    You needed more indent - inside lists you need 8 spaces Jan 14, 2014 at 1:08
  • 3
    @JohnPalmer Make that an answer? Jan 14, 2014 at 1:27
  • XML in a code bloock works poorly, makes my post look like garbage Feb 8, 2014 at 16:25

1 Answer 1


To get code formatting inside a list, you need to indent by an extra 4 spaces for a total of 8 spaces.

If you just use 4 spaces, markdown assumes you are continuing the list.

You must log in to answer this question.

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