runarberg / mathup

Easy MathML authoring tool with a quick to write syntax
https://runarberg.github.io/mathup
MIT License
63 stars 10 forks source link

Stop trowing so many exceptions #5

Closed runarberg closed 9 years ago

runarberg commented 9 years ago

This package follows unnecessarily strict semantics and trows on every itchy bitchy mistake. When evaluating an expression interactively (such as in the try-box on https://runarberg.github.io/ascii2mathml) it is not uncommon to see dozens of error outputs in the browser console before the expression is ready. By fixing this not only means appeasing the clients console, but genuine bugs will more likely be detected by monitoring the console output.

on many occasions we could easily fall back to rendering incomplete expressions. Such as for an open fence without a closing fence we could render the opening fence as an operator, for incomplete fractions or sub- or superscript we could simply display the notation symbols as operators as well, so ascii2mathml(x^)<math><mi>x</mi><mo>^</mo></math> and incomplete roots could render as series a of identifiers (sqrt<math><mi>s</mi><mi>q</mi><mi>r</mi><mi>t</mi></math>).

runarberg commented 9 years ago

Another solution would be to return an empty <mrow> when applying an operation on nothing. That is sqrt<msqrt><mrow></mrow><msqrt>.

runarberg commented 9 years ago

Released to v0.5.2. Closing now, possible revisit in the future.