Conversation
|
@sangwinc did you not implement the stuff from https://github.com/numbas/unicode-math-normalization ? |
| $filterstoapply[] = '101_no_floats'; | ||
| } | ||
|
|
||
| // Filter 180 MUST run BEFORE Filter 150! |
There was a problem hiding this comment.
The order of filters is based purely on the numbers at the start of the filter name. 180 will never get executed before 150, so if one wants to do something before 150, that something needs to be named accordingly.
The array filterstoapply is not the execution order for them. It is just the set of filters that need to be included in the filter pipeline; the pipeline construction logic then sorts that set and initialises the filters with any options they might have, as well as checks any issues related to incompatible filters.
Interesting, though, that the filter existed but was not used in the actual logic. Only in the input fixtures tests? Guess someone got busy with something else, and this was forgotten?
There was a problem hiding this comment.
Interesting, though, that the filter existed but was not used in the actual logic. Only in the input fixtures tests? Guess someone got busy with something else, and this was forgotten?
Indeed @aharjula that's certainly probably me! Sorry, we can look into this.
|
Thanks so much @Bjoern-Ge I really appreciate you sending a pull request. Renaming it's simple (and we should stick to our current pattern, so important). |
| // handle latter, also strings are safe already. | ||
| // Option C: Allow only the most common superscripts: ², ³, ¹ | ||
| // These are 2-byte UTF-8 characters and work without UTF-8mb4 requirement. | ||
| $superscript = ['²' => '2', '³' => '3', '¹' => '1']; |
There was a problem hiding this comment.
@christianp and I started a collection of patterns like this here.
https://github.com/sangwinc/unicode-math-normalization
We should link into this, rather than hard-wiring lists into the code.
Enable Unicode superscript input (², ³, ¹) for algebraic inputs.
Only supports ², ³, ¹ (2-byte UTF-8, they are present on a German keyboard)
Results:
x² => x^2
x³ => x^3
x²+x² => x^2+x^2
x²² => x^22
added tests in
tests/fixtures/test_strings.json
addresses: #1107 (comment)