I created a table like this:

|Heading 1              |Heading 2              |
| R1                    | R2                    |

I preserve the table format by indenting the table four space (i.e. code mode) However, The code mode is broken if there isn't a blank line immediately before the code. Like this: Characters here without a blank line before the table breaks the code mode. +-----------------------+-----------------------+ |Heading 1 |Heading 2 | +-----------------------+-----------------------+ | R1 | R2 | +-----------------------+-----------------------+

I can't find anything on Markdown Manual and StackExchange help on markup about it.

Why does the code block need a blank line immediately before it? I thought four spaces represented a code block. Not a blank line plus four spaces.

1 Answer 1


The short answer is "so the parser can pick up what you intend"

The longer answer involves experimentation with regexes. I really don't think that's necessary.

Here's your basic rule of thumb: HTML doesn't care about whitespace, and neither should you (except when it's used as the four spaces to indicate indentation but that isn't whitespace, that's formatting, blah blah we can go off on pedantic 80 mile discussions for days). Just put a couple extra carriage returns and quit worrying about making your post as compact as possible. Use them to indicate new thoughts, new ideas, to prevent run on paragraphs and to segment each independent section from one another. Otherwise you end up with long messes of paragraphs like this one and you really don't want to confuse everyone. Just hit enter. It's cheap. Costs one extra downstroke of your pinky.

You must log in to answer this question.

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