24

According to the Markdown help, code blocks within lists have to be indented two levels, i.e., eight spaces, like this:

* Item

        Code
12345678

(Counter just for illustration). In Q&A, this renders as follows:

  • Item

    Code
    

If I do the exact same thing in Documentation, I get this:

Eight space indent in documentation

Notice the extra white space in the code block (freehand red circle courtesy of Abhitalks). To get my code properly aligned, I have to use six spaces:

* Item

      Code
123456

resulting in

Six space indent in documentation

It should be the same everywhere, shouldn't it?

ETA: It wouldn't bother me (much), but because Ctrl+K toggles indentation and doesn't just add four spaces, there is no easy way to get two levels of indentation – so I often add a dummy character without indentation on the line before an indented code block and use Ctrl+K to indent again (and then delete the dummy character), but this breaks if the required indentation is six instead of eight spaces.

6
  • It’s a different Markdown engine AFAIK.
    – Jed Fox
    Commented Dec 31, 2016 at 21:09
  • 2
    @JF: Why would they give it a different markup engine? Commented Dec 31, 2016 at 22:53
  • @NicolBolas I remember reading that they did, but I can't find the relevant post currently. Commented Dec 31, 2016 at 22:54
  • 4
    @NicolBolas I think they’re hoping to move Q&A to the new engine — CommonMark
    – Jed Fox
    Commented Dec 31, 2016 at 22:55
  • @BenjaminW.- There, added a freehand circle!
    – Abhitalks
    Commented Jan 2, 2017 at 5:47
  • 3
    @Abhitalks Fantastic! Now it makes sense ;) Commented Jan 2, 2017 at 5:50

0

Browse other questions tagged .