Some user inputs were causing the server to fail due to malformed XML. When retrieving MathML, the generated text is transformed into HTML, which is not 100% compatible with XML. The current solution uses the browser's native XMLParser to transform HTML into XML and ensures that only valid XML is sent to the server.
Description
Some user inputs were causing the server to fail due to malformed XML. When retrieving MathML, the generated text is transformed into HTML, which is not 100% compatible with XML. The current solution uses the browser's native XMLParser to transform HTML into XML and ensures that only valid XML is sent to the server.
Steps to reproduce
Unit tests
Ui
<math xmlns="http://www.w3.org/1998/Math/MathML"><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">«</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px"><</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">»</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">></mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">§</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">&</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">¨</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">"</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">'</mo><mo mathvariant="bold" mathcolor="#7F0000" mathsize="48px">'</mo></math>
<math><mn mathcolor="red">"4</mn><mo>×</mo><mi>x</mi></math>
#taskid 45734
Changes.md
fix: change htmlEntitiesToXmlEntities' implementation in order to assure only valid XML