Words immediately after the end mark "$$" of equation block can render in the editing view but not in the reading view

If I enter some content in the same line before the beginning $$ or after the ending $$ of an equation block, the equation will be rendered correctly in the editing view but not in the reading view:

Test

We may want the editing mode to automatlcally divide “xxx$$” into separate lines if the “$$” is recognized as a delimiter of some equation block.

“xxx$$” and “$$xxx” should never appear in the file if the editing view can recognize and render the equation block correctly, since in this case it’s very hard to detect the mistyping
which will cause misrender in reading and in other apps.

Alternatively, we can stop rendering this situation in the editing view to keep a consistent behavior with the reading view.

Duplicate of