Currently LuaTeX ignores "null paragraphs" (see the manual at the end of section 3.3.2 "How it works"), but it is actually doing so only for paragraphs created with end_graf. enter_display_math ignores paragraphs if they only contain local_par nodes, but not if they also contain dir nodes. This is somewhat inconsistent, so it would be nice if enter_display_math would discard paragraphs like end_graf. I attached a patch. It is almost identical to the change in https://gitlab.lisn.upsaclay.fr/texlive/luatex/-/commit/908e51adaad4b4048fed... but it is even smaller, since enter_display_math already discard paragraphs containing only local_par nodes. Even though this change is less disruptive, there might be more concerns about backwards compatibility today than three years ago, if this is the case a new value to \matheqdirmode can be added. Udi