-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish negation from subtraction #60
base: master
Are you sure you want to change the base?
Conversation
It's been about 8 months with no comments. @jipsen, it'd be great to get your input on whether the grammar change is reasonable, and if Peter, @adius, or someone else would you be willing to test this that'd be great. I hate to make big changes to something so many people use without input or validation from anyone else. |
If MathJax moves to a AsciiMath-to-TeX-to-MathJax pipeline, this change may not be necessary, as the TeX processor already handles negation better, without needing any changes to how AsciiMath is converted to TeX. |
Do you still want my feedback or is this obsolete? =P |
@adius, I haven't heard anything about MathJax changing their process, and I haven't yet merged this into master, so would certainly still welcome feedback, even if that feedback is "this issue this is trying to address isn't a big deal, so let's not make the code more complicated." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out the test file and the output looks good to me. The code looks fine, too. (Altough we should really start to use a code formatter - e.g. https://github.com/prettier/prettier. The code formatting is really hacky 😂)
Oh, and I think differentiating between negation and subtraction is important! ;-) |
Thanks for looking at it, @adius. I'm still slightly scared to merge this, since it's very likely I missed an edge case, and MathJax's update cycle is pretty long. But like you said it's probably important so I'll try to finish this up and merge it. |
This change attempts to address issue #30 by adjusting the asciimath grammar to distinguish negation from subtraction.
This isn't perfect. For example
-5 and -4
still treats the second negation as subtraction.I'd encourage others to see if you can find a case this breaks on.