Maths blocks are difficult to add in editor (and impossible to render on copy paste) and cause PagedJS output errors if not done properly
Please note this issue is a duplicate of wax/wax-prosemirror#44
Expected behaviour
As in the Ketida (FKA Editoria) docs:
Insert Mathematical Function, Formula, or Equation as a Block
Follow the above instructions using two dollar signs at the beginning and end of the math in LaTex syntax.
The math will be centered on the page on its own line(s).
Current behaviour
In the OEN instance and the Wax demo, it's impossible to insert blocks of maths, only inline maths works and the editor interprets blocks of maths as inline maths with another set of dollar signs outside of it.
So the maths doesn’t render properly in the editor, and then an error is generated on output of PagedJS PDF saying ‘ParseError: KaTeX parse error: Can't use function '$' in math mode at position 1’.
Steps to reproduce
- Go to Wax demo
- Type in
\frac{1}{2}
or any basic equation (without adding a space after the first set of dollars) - See that the maths renders as inline maths with another set of dollars outside of it (see screenshots below)
- If you do the same in the OEN instance, on export with one of the templates (e.g. Juans les Pins or Les Angles) you will get an error
Note the workaround for this is to add a space after you type two sets of dollars and then type your maths. But this isn't ideal because many people will copy paste from a separate maths editor/validator and that doesn't render properly.