Skip to content
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

Don't convert attribute to boolean unless the default is a boolean. #1356 #1511

Merged
merged 1 commit into from Jul 6, 2016

Conversation

Projects
None yet
3 participants
@dpvc
Copy link
Member

commented Jun 7, 2016

Don't convert attribute to boolean unless the default is a boolean. Resolves issue #1356.

@pkra pkra added this to the MathJax v2.x.x milestone Jun 7, 2016

@zorkow

This comment has been minimized.

Copy link
Member

commented Jul 6, 2016

I don't quite understand what goes on in the code as the condition of the if is really a mystery to me.
But if it works that's fine.

@dpvc

This comment has been minimized.

Copy link
Member Author

commented Jul 6, 2016

Yes, the condition is a bit complicated. It is trying to convert a string to a boolean only when the type of the attribute is boolean, but we don't actually have any data on what the type should be. So we look at the default value (if any) and if it is boolean, then convert, or if it is "inherit" (some booleans are inherited from parent elements, so this is really a punt), or if it is "auto" (a special internal value that means the value is computed automatically in some when when not given) and the default value for that computation is boolean, then convert. All this is an attempt to determine whether the attribute should be boolean or not.

In v3.0, we may want to have a more complete description of valid MathML, and include that sort of information for this kind of use (as well as validating MathML input, which we don't currently do).

@dpvc dpvc merged commit d29f299 into mathjax:develop Jul 6, 2016

@dpvc dpvc deleted the dpvc:issue1356 branch Jul 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.