And there is a subtle difference between display math within a paragraph and display math between paragraphs so you cant tell from context. Based on markdown-it plugin markdown-it-texmath. Here is how you could configure it.
Startlatex sum_ i0 n-1 a_i b_i2 endlatex.
Integrated in native markdown viewer. Sum_n110 n2 is rendered as sum_n110 n2. A b c fx int_-inftyinfty hat fxie2 pi xi x dxi. P x frac 1 sigmasqrt 2pi e frac - x-mu2 2sigma2.