1

On SO, if you try to post a question or answer with code in it that is formatted using HTML <code></code> tags, you trigger the "Your post has improperly formatted code in it" warning; this is a problem if you have a long code snippet in your post, as the 4-spaces-per-line Markdown code formatting adds up. (Before you say 'minimize your example!', some things simply cannot be reproduced or demonstrated with a short code example...)

Why would using HTML instead of Markdown for code formatting always trigger this warning? Do <code></code> tags have a different effect than the Markdown four-spaces convention?

1
  • How large is your code sample? If it's large enough that you really can't format it with spaces, I rather doubt that it's a minimal reproducible example.
    – Servy
    Commented Jan 27, 2015 at 20:57

1 Answer 1

5

<code></code> is for inline code formatting, which for a large code block is definitely improper formatting. Try <pre><code></code></pre> instead.

You must log in to answer this question.

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