Bug: Equation import to dom failing
Hello,
I have a problem with equations not beeing parsed correctly from DOM once created. Creation works fine, but once it parse HTML into the editor it transforms the functions into text and they are lost on a new save.
Once created the equation is fine
Parsed the before created question results in equation loss and transform to text.
I tried fixing but no success.
I randomly tried setting priority to 4 and now it works. Could anybody please explain what the reason for this behavior is? How can I prevent running into more issues like this in the future?
This is fixed in the current codebase. The playground's EquationsExtension now registers a DOMImportExtension rule that matches <span>/<div> elements with a data-lexical-equation attribute, so the equation data round-trips correctly through HTML export/import.
The original issue was that EquationNode had no importDOM(), so its exported HTML fell through to the generic <span> handler and lost the equation data. The new rule-based import system resolves this without needing a priority workaround.