desmosinc / mathquill

Magic textboxes where you can type math as easily as writing!
mathquill.com
137 stars 42 forks source link

coordinate autoSubscript with charsThatBreakOut #258

Closed eluberoff closed 1 year ago

eluberoff commented 1 year ago

autoSubscriptNumerals was overriding the behavior for charsThatBreakOutOfSupSub.

As a result:

  1. we wouldn't break out of subscripts in this mode for expected characters (reported by suzanne) --and--

  2. It also made it impossible to type parentheses in a subscript, or a subscripted subscript.

The latter might be preferable since those aren't things we can interpret in the calculator, but we still need to be able to handle them since they're valid and pasteable latex.

TODO:

jwmerrill commented 1 year ago

Looks like this is failing some tests

jwmerrill commented 1 year ago

I think it's pretty confusing to have global config leak between tests like this.

Wondering if we should restructure the tests that need special config to create independent MathField instances that they configure separately.

This is where the mq variable is being populated currently: https://github.com/desmosinc/mathquill/blob/21b2a15bed158dd5f59b67a448f4bb454a3dba60/test/unit/backspace.test.js#L4-L9

but for tests that need a specially configured mq it seems like we could do something similar to that locally, passing in the special config as the second argument to MathField.

eluberoff commented 1 year ago

oh interesting. if you pass it in as a second argument it doesn't pollute the global config for MQ? I can play with that.