10

In this answer, I have a code block:

public class LocalizedStrings 
{ 
    public string this[string key] 
    { 
        get 
        { 
            return App.ResourceLoader.GetForViewIndependentUse().GetString(key); 
        } 
    } 
}

In this post, it gets formatted correctly, but I can't seem to get it to format properly in the linked answer. Is it because of the bullets used before it?

3

1 Answer 1

17

You're putting it directly after a list. A list uses the same indentation scheme as a code block to continue a list item. So, you have two options:

  1. Indent your code another four spaces (eight spaces total), if you wish the code block to be a part of the final list item.

  2. Add an empty comment (<!-- -->) after your list and before the code block to forcibly break out of the list and let the Markdown parser start a code block with normal indentation.

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