Multiple lines inline math

Is there a way to make a line break inside an inline formula? Maybe a line break that doesn’t break the formula, or somehow wrap the formula… Or make all the formulas, including $$…$$ inline…

I want the following to work
foo $a +

Without line breaks, long formulas are difficult to write and change later.

This is markdown formatting actually. I don’t think it supports inline going over multiple lines.
Logseq seems to support the standard markdown.
I looked at this site:

And copied that over into Logseq:
Renders as expected.