When writing an answer to a question on my phone using the Android Chrome browser, I cannot include a block of sample code using the 4 spaces formatting rule. It just displays the code as one long sentence. Is there another way of displaying multiple lines of formatted and indented code, and are there any plans to improve the mobile site answer formatting?

This is trying to be a code block
And written on a mobile browser

Edit: OK, I've worked out the problem. Just my lack of knowledge of the correct markdown (and possibly unclear markdown instructions). You have to have a clear line before a 4-space indent to make a code block. I've possibly found another issue with markdown in comments though. Using underscores to make text italic didn't work for me just now from my phone. I'll try again to confirm.

Edit: Problem resolved. The Chrome browser for Android does not display italic text. I tried it in the standard browser, and it looked fine.

  • I've got a no-repro on my Nexus 7's Chrome-for-Android: meta.stackexchange.com/a/194235/186560. Are you sure you didn't have some other markdown situation preventing your code block, like a preceding list item, which requires eight spaces?
    – apsillers
    Commented Aug 21, 2013 at 23:47
  • What happens when you make a code block successfully on a non-mobile computer and then try to edit it in a mobile one? Does the mobile browser destroy the code block when making the edit? Also, could you edit your question with an example?
    – apsillers
    Commented Aug 21, 2013 at 23:53
  • I just edited the question on my phone. Added two lines at the bottom that had 4 preceding spaces on each line. As you can see they have come out as normal text. I'll try the make on PC, edit on phone when I get to work in an hour
    – Erresen
    Commented Aug 22, 2013 at 5:45
  • Also, that comment I just made should have italic text with the underscore markdown. Looks like that gets removed too.
    – Erresen
    Commented Aug 22, 2013 at 5:46
  • this should be italic and this should be bold
    – Erresen
    Commented Aug 22, 2013 at 7:06

1 Answer 1

  • To place a code block a clear line must be placed before the code block.
  • Chrome for Android does not display italic text correctly for sans-serif font, so the italic markdown doesn't work. Apparently this is a known bug and Google are working to fix it.

You must log in to answer this question.

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