Discrepancy between handling of math blocks in live preview and reading view

Block math should be written either this way:

Text 
$$math$$ 
Text

or this way

text
$$
math
$$
text