Whitespace should be trimmed in token elements
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 56
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/w3c/mathml-core/issues/165
However there does not seem to one here and the current draft is silent on the issue.
MathML specifies that white space at start and end of token elements is ignored (essentially like whitespace at ends of a HTML <p>) Almost all examples in the current MathML4 draft have space in token elements that needs to be removed while rendering.
For example
https://w3c.github.io/mathml/#examples-5
<mfrac linethickness="3px">
<mrow>
<mo> ( </mo>
<mfrac linethickness="0">
<mi> a </mi>
<mi> b </mi>
</mfrac>
<mo> ) </mo>
<mfrac>
<mi> a </mi>
<mi> b </mi>
</mfrac>
</mrow>
<mfrac>
<mi> c </mi>
<mi> d </mi>
</mfrac>
</mfrac>
Renders in Firefox as

The rendering in Edge is

in which the variables are not italic and the space is affecting the spacing. If the space characters are deleted, edge renders this as

MathML Core should mandate the firefox behaviour here, for compatibility with the existing corpus of MathML documents and for general usability and user expectations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MathML Core draft and the examples at https://w3c.github.io/mathml/#examples-5, then compare the documented token-element behavior with the Firefox and Edge renderings described here. Done means the specification clearly mandates the expected handling of leading and trailing whitespace in token elements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100