You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No – there's a difference between markup attributes and DOM properties. The properties are what's missing – as evidenced by undefined in the browser, as we've seen. But the attributes of course still exist. I'm not proficient in mathml, but I assume that specifying them is in fact needed to accomplish some things.
Markup attributes are typically specified in the mathml markup, but they can also be set via JS, like this: $0.setAttribute('displaystyle', 'normal') (You can try that on this page, if you inspect & select the element in their example – you will see the formula change its layout.
With the attributes, the most important thing is to get their types /codecs right. See the types in the table above.
If the type is not mentioned, it's just a string, so for them the codec would be just StringAsIs.
At the moment we encode enum-type values as strings as well – just specify their allowed values in the scaladoc.
For booleans, this page says they they are encoded as "true" and "false" strings, so for that, we should use BooleanAsTrueFalseStringCodec
If not sure about a particular attribute, just set the type to string. It's a safe fallback, because all those values are represented as strings in the mathml markup.
If it's not too much work, it would be nice to indicate which element(s) each of these applies to in the scaladoc (the info is in the table)
The text was updated successfully, but these errors were encountered:
@raquo thanks for your help on the previous issue - I’m waiting for my mathml curiosity to come back after a busy period at work, or scala ja dom to release… whichever comes first.
See #105 -
No – there's a difference between markup attributes and DOM properties. The properties are what's missing – as evidenced by undefined in the browser, as we've seen. But the attributes of course still exist. I'm not proficient in mathml, but I assume that specifying them is in fact needed to accomplish some things.
Markup attributes are typically specified in the mathml markup, but they can also be set via JS, like this: $0.setAttribute('displaystyle', 'normal') (You can try that on this page, if you inspect & select the element in their example – you will see the formula change its layout.
Looks like this is the list of attributes: https://developer.mozilla.org/en-US/docs/Web/MathML/Attribute
Don't add the ones with the trash icon.
With the attributes, the most important thing is to get their types /codecs right. See the types in the table above.
If the type is not mentioned, it's just a string, so for them the codec would be just StringAsIs.
At the moment we encode enum-type values as strings as well – just specify their allowed values in the scaladoc.
For booleans, this page says they they are encoded as "true" and "false" strings, so for that, we should use BooleanAsTrueFalseStringCodec
If not sure about a particular attribute, just set the type to string. It's a safe fallback, because all those values are represented as strings in the mathml markup.
If it's not too much work, it would be nice to indicate which element(s) each of these applies to in the scaladoc (the info is in the table)
The text was updated successfully, but these errors were encountered: