Skip to content

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

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

Merged
merged 1 commit into from
Jul 6, 2016

Conversation

dpvc
Copy link
Member

@dpvc dpvc 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
Copy link
Member

zorkow 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
Copy link
Member Author

dpvc 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 issue1356 branch July 6, 2016 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants