-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fixed a spacing issue involving sizing commands and operators #136
Conversation
This doesn't really fix the general problem, just a specific case of it. For example, something like |
Okay, sorry. That was a bad example, because it does what you want, but not for the reason you want. Here's a better example:
In MathJax, it (correctly) puts space to the left of the This doesn't, because the interaction here is a close-bin interaction: I'm not sure what the solution to this is. It might be something like "put an empty element of the previous type inside". I'm also not sure whether the want the space to be modified by the |
…r span to be a "mbin" only if the first child is an "mbin"
expect("\\Huge x + 1").toBuild(); | ||
}); | ||
}); | ||
|
||
describe("A text parser", function() { |
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 took the other tests out because the string I would've needed to match would've been quite long making the test prone to failure from unrelated changes. I was thinking about using jQuery in the tests to verify the structure of some of the markup that's being produced. Thoughts?
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 think that this isn't something that should be tested with code, but should probably use a Huxley test instead. Generally, it's not helpful to verify that the code we write produces the structure we tell it to produce, because the test will just ensure that we produce the code tells it to, and not that the produced output is useful. The Huxley tests ensure that the code we write produces something that looks correct.
Did you ever get huxley tests to work?
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 haven't spent much time looking at them. I did install docker though. I'll work on getting them running today. Are you happy with the current solution? If so, I'll create some Huxley tests.
How are you testing MathJax? If you go here, you should get something that uses the same fonts as KaTeX does, so it's easier to tell the difference. |
prev.type === "close") { | ||
type = "mbin"; | ||
} | ||
} |
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.
This is really just turning in to special casing for all of the different interactions, which is annoying to deal with (and there are a whole lot that aren't captured here). As @spicyj points out, MathJax doesn't actually do spacing with \Huge
correctly, and we're not entirely sure how we want to do spacing overall, so maybe we should put this on hold until we can discuss what we want exactly to happen.
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.
Line 778 is totally wrong. The intent is right, but the implementation is wrong. Ugh. Fix coming shortly then I'll leave it there while we discuss what to do.
I was using http://www.mathjax.org/demos/scaling-math/. I tried the fiddle, but it's using the same fonts as the MathJax site. |
….value.value[0] instead
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This is so the size commands don't hide the types of their enclosed atoms. Addresses KaTeX#136. This slightly changes the vertical position of the Sizing test. Not sure the vertical position matters, so change the test.
This addresses issue #30.
TODO: