# 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
Member

### dpvc commented Jun 7, 2016

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

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.
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).