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

Whitespace should be trimmed in token elements #149

Open
davidcarlisle opened this issue May 29, 2022 · 2 comments
Open

Whitespace should be trimmed in token elements #149

davidcarlisle opened this issue May 29, 2022 · 2 comments

Comments

@davidcarlisle
Copy link
Collaborator

davidcarlisle commented May 29, 2022

There is a related issue in the repo for the full spec

#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

image

The rendering in Edge is

image

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

image

MathML Core should mandate the firefox behaviour here, for compatibility with the existing corpus of MathML documents and for general usability and user expectations.

@fred-wang
Copy link
Contributor

For the record, #165 is about trimming whitespace when parsing attributes, which is much easier to do.

@davidcarlisle
Copy link
Collaborator Author

@fred-wang er yes I should probably delete that opening line as it's just confusing in this context

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

No branches or pull requests

2 participants