Issue
When consecutive inline formulas appear on separate lines, the line breaks between them are removed, causing them and all lines in between to appear on a single line. Additionally, the formulas are not rendered correctly as formulas, but instead the consecutive dollar signs ($) are removed. This only occurs if there is no space between the inline formulas. If there is some other character in between, the formulas are not parsed but shown in raw text.
Examples

https://kagi.com/assistant/e90be69d-1cce-4c89-852c-9077fec31255

https://kagi.com/assistant/6e4dfff4-751a-4db8-8ce7-c516125fafde
This does not appear to be model-specific, as copying and pasting the response into some text editor shows that the raw output contains the correct syntax.
Expected Behaviour
The output should instead be the following:

(HTML edited to show expected rendering)

(HTML edited to show expected rendering)
The expected behaviour is the same as the behaviour of LaTeX, which I have tested in Overleaf.