-
Notifications
You must be signed in to change notification settings - Fork 89
Day 13: “A11y Considerations in Math on the Web” / Manuel Sánchez #204
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
base: advent25
Are you sure you want to change the base?
Conversation
|
Ready to review/merge, @matuzo ! Hope you like it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for your contribution, it was interesting to learn a bit more about MathML!
| Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind. | ||
|
|
||
| ## Heading | ||
| Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this flows a bit nicer with what you want to say. i tried to separate the cause and effect as it were.
| Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula. | |
| The web is full of many different and interesting approaches for representing formulas. In reality, [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option to solve this problem, even if it wasn’t originally designed for the web. A big plus is that it has its own syntax, MathML provides various elements that give the correct semantics to the different parts of a formula. |
| Let's take the famous Pythagorean Theorem as an example. | ||
|
|
||
| ## Heading | ||
| <section style="margin-bottom: 2rem" > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to follow your own advise and use an aria-label here?
| </section> | ||
| ``` | ||
|
|
||
| Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>role="math"</code></a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve accessibility. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>role="math"</code></a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve accessibility. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have: | |
| Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>"math"</code> role</a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve an accessibile result. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have: |
| </math> | ||
| ``` | ||
|
|
||
| <p class="highlight"><strong><abbr title="too long; didn't read">TL;DR:</abbr></strong> MathML Core is what browsers implement today; MathML 4 is the broader language evolving around it..</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be at the top of the section. now it’s more of a “too late, did read” 🤓
|
|
||
| ## The future of MathML | ||
|
|
||
| Before we look ahead, it's useful to understand where MathML comes from and why there's both a 'Core' and a 'version 4' in development. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be the curse of knowledge on your part, but i have no idea that there’s a “core” and “version 4”. perhaps this section can be restructured a bit to include some more history and explain this?
| Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind. | ||
|
|
||
| ## Heading | ||
| Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind. | ||
|
|
||
| ## Heading | ||
| Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though the web is full of many different and interesting approaches
it might be worth naming some of the other approaches.
| </math> | ||
| ``` | ||
|
|
||
| Unlike plain HTML with <code>sup</code> or <code>span</code>, which only describe presentation, MathML defines each role explicitly: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good selling point for MathML. are there other solutions that offer this functionality too? or is this exclusive to MathML?
No description provided.