I prefer to put the equation delimiters on different lines than the equation contents, so I added a line break at the location of my cursor in the above image.
When I do this, Anki adds </div><div> to the HTML code, causing the equation to stop working, as shown here:
I don’t know why Anki uses a div block here, instead of using <br> (it seems to be because the code already has div blocks), but inserting <br> would fix this problem.
Version <U+2068>24.11 (87ccd24e)<U+2069>
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
If you want to use newlines in a MathJax expression, please use Shift+Enter instead of just Enter, as a normal newline will prevent MathJax from working correctly. [Math & Symbols - Anki Manual]
That is a solution for inserting a line break in the displayed equation, but I was talking about just code line breaks. (I’ve never heard of \displayedlines, though. I’ll have to check that out!)
I don’t think that’s always true. Sometimes ENTER inserts <br>, which works fine. Anyway, it seems like a bug (or at least bad UI design that) that Anki sometimes inserts div tags inside MathJax equations when this causes them to break